예제 #1
0
        /// <summary>
        /// Registers the specified context.
        /// </summary>
        /// <param name="context">The context.</param>
        public void Register([NotNull] ILoggingConventionContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            context.Services.AddTransient <ISerilogDiagnosticListener, HostingDiagnosticListener>();
            context.Services.AddHostedService <HostedService>();
        }
예제 #2
0
        /// <summary>
        /// Registers the specified context.
        /// </summary>
        /// <param name="context">The context.</param>
        public void Register(ILoggingConventionContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            context.AddConfiguration(context.Configuration.GetSection("Logging"));
            var logLevel = _options.GetLogLevel(context);

            if (logLevel.HasValue)
            {
                context.SetMinimumLevel(logLevel.Value);
            }
        }
예제 #3
0
 static LogLevel? @delegate(ILoggingConventionContext x) => LogLevel.Error;
예제 #4
0
 //#endif
 //#if (!SkipLogging)
 public void Register(ILoggingConventionContext context)
 {
 }
예제 #5
0
 static LogLevel?func(ILoggingConventionContext x) => LogLevel.Error;