public ZLoggerLogProcessorLoggerProvider(IAsyncLogProcessor processor)
 {
     this.processor = processor;
 }
        public static ILoggingBuilder AddZLoggerLogProcessor(this ILoggingBuilder builder, IAsyncLogProcessor logProcessor, Action <ZLoggerOptions> configure)
        {
            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            builder.AddZLoggerLogProcessor(logProcessor);
            builder.Services.Configure(configure);

            return(builder);
        }
Пример #3
0
 public AsyncProcessZLogger(string categoryName, IAsyncLogProcessor logProcessor)
 {
     this.categoryName = categoryName;
     this.logProcessor = logProcessor;
 }
        public static ILoggingBuilder AddZLoggerLogProcessor(this ILoggingBuilder builder, IAsyncLogProcessor logProcessor)
        {
            builder.AddConfiguration();

            builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton <ILoggerProvider, ZLoggerLogProcessorLoggerProvider>(x => new ZLoggerLogProcessorLoggerProvider(logProcessor, x.GetService <IOptions <ZLoggerOptions> >())));
            LoggerProviderOptions.RegisterProviderOptions <ZLoggerOptions, ZLoggerLogProcessorLoggerProvider>(builder.Services);

            return(builder);
        }
Пример #5
0
 public ZLoggerLogProcessorLoggerProvider(IAsyncLogProcessor processor, IOptions <ZLoggerOptions> options)
 {
     this.processor = processor;
 }