diff --git a/src/Serilog.Sinks.Seq/SeqLoggerConfigurationExtensions.cs b/src/Serilog.Sinks.Seq/SeqLoggerConfigurationExtensions.cs index c6cd789..5bc9b19 100644 --- a/src/Serilog.Sinks.Seq/SeqLoggerConfigurationExtensions.cs +++ b/src/Serilog.Sinks.Seq/SeqLoggerConfigurationExtensions.cs @@ -41,6 +41,9 @@ public static class SeqLoggerConfigurationExtensions /// The base URL of the Seq server that log events will be written to. /// The minimum log event level required /// in order to write an event to the sink. + /// The switch controlling the minimum log event level required + /// in order to write an event to the sink. + /// Notice, if the parameter is specified, the should not be used. /// The maximum number of events to post in a single batch. /// The time to wait between checking for event batches. /// Path for a set of files that will be used to buffer events until they @@ -73,6 +76,7 @@ public static LoggerConfiguration Seq( this LoggerSinkConfiguration loggerSinkConfiguration, string serverUrl, LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, + LoggingLevelSwitch? restrictedToMinimumLevelSwitch = null, int batchPostingLimit = DefaultBatchPostingLimit, TimeSpan? period = null, string? apiKey = null, @@ -115,7 +119,7 @@ public static LoggerConfiguration Seq( return loggerSinkConfiguration.Conditional( controlledSwitch.IsIncluded, - wt => wt.Sink(batchedSink, options, restrictedToMinimumLevel, levelSwitch: null)); + wt => wt.Sink(batchedSink, options, restrictedToMinimumLevel, restrictedToMinimumLevelSwitch)); } var sink = new DurableSeqSink( @@ -131,7 +135,7 @@ public static LoggerConfiguration Seq( return loggerSinkConfiguration.Conditional( controlledSwitch.IsIncluded, - wt => wt.Sink(sink, restrictedToMinimumLevel, levelSwitch: null)); + wt => wt.Sink(sink, restrictedToMinimumLevel, restrictedToMinimumLevelSwitch)); } /// @@ -142,6 +146,9 @@ public static LoggerConfiguration Seq( /// The base URL of the Seq server that log events will be written to. /// The minimum log event level required /// in order to write an event to the sink. + /// The switch controlling the minimum log event level required + /// in order to write an event to the sink. + /// Notice, if the parameter is specified, the should not be used. /// A Seq API key that authenticates the client to the Seq server. /// Used to construct the HttpClient that will send the log messages to Seq. /// An that will be used to format (newline-delimited CLEF/JSON) @@ -153,6 +160,7 @@ public static LoggerConfiguration Seq( this LoggerAuditSinkConfiguration loggerAuditSinkConfiguration, string serverUrl, LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, + LoggingLevelSwitch? restrictedToMinimumLevelSwitch = null, string? apiKey = null, HttpMessageHandler? messageHandler = null, ITextFormatter? payloadFormatter = null, @@ -163,6 +171,6 @@ public static LoggerConfiguration Seq( var ingestionApi = new SeqIngestionApiClient(serverUrl, apiKey, messageHandler); var sink = new SeqAuditSink(ingestionApi, payloadFormatter ?? CreateDefaultFormatter(formatProvider)); - return loggerAuditSinkConfiguration.Sink(sink, restrictedToMinimumLevel); + return loggerAuditSinkConfiguration.Sink(sink, restrictedToMinimumLevel, restrictedToMinimumLevelSwitch); } } \ No newline at end of file