/// <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>(); }
/// <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); } }
static LogLevel? @delegate(ILoggingConventionContext x) => LogLevel.Error;
//#endif //#if (!SkipLogging) public void Register(ILoggingConventionContext context) { }
static LogLevel?func(ILoggingConventionContext x) => LogLevel.Error;