public static ILoggerOptionsBuilder UseMicrosoftExtension(this ILoggerOptionsBuilder builder, Action <ILoggingBuilder> configure)
 {
     builder.Services
     .AddLogging(configure)
     .AddEventBusLogger <MicrosoftEventBusLogger>();
     return(builder);
 }
 public static ILoggerOptionsBuilder UseInnerLogger(this ILoggerOptionsBuilder builder)
 {
     builder.Services
     .AddSingleton <IMqttNetLogger, MqttNetLogger>()
     .AddEventBusLogger <EventBusLogger>();
     return(builder);
 }
Beispiel #3
0
        public static ILoggerOptionsBuilder UseSerilog(this ILoggerOptionsBuilder builder, Action <LoggerConfiguration> configure)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            var cfg = new LoggerConfiguration();

            configure.Invoke(cfg);
            return(UseSerilog(builder, cfg.CreateLogger()));
        }
Beispiel #4
0
        public static ILoggerOptionsBuilder UseSerilog(this ILoggerOptionsBuilder builder, ILogger logger)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            Log.Logger = logger;
            builder.Services
            .AddSingleton(logger)
            .AddEventBusLogger <SerilogEventBusLogger>();
            return(builder);
        }
Beispiel #5
0
 public static ILoggerOptionsBuilder UseSerilog(this ILoggerOptionsBuilder builder)
 => UseSerilog(builder, cfg => cfg.CreateLogger());