1414
1515using System ;
1616using Serilog . Configuration ;
17+ using Serilog . Core ;
18+ using Serilog . Events ;
1719using Serilog . Extensions . Logging ;
1820
1921namespace Serilog
@@ -28,12 +30,20 @@ public static class LoggerSinkConfigurationExtensions
2830 /// </summary>
2931 /// <param name="configuration">The `WriteTo` object.</param>
3032 /// <param name="providers">A <see cref="LoggerProviderCollection"/> to write events to.</param>
33+ /// <param name="restrictedToMinimumLevel">The minimum level for
34+ /// events passed through the sink. Ignored when <paramref name="levelSwitch"/> is specified.</param>
35+ /// <param name="levelSwitch">A switch allowing the pass-through minimum level
36+ /// to be changed at runtime.</param>
3137 /// <returns>A <see cref="LoggerConfiguration"/> to allow method chaining.</returns>
32- public static LoggerConfiguration Providers ( this LoggerSinkConfiguration configuration , LoggerProviderCollection providers )
38+ public static LoggerConfiguration Providers (
39+ this LoggerSinkConfiguration configuration ,
40+ LoggerProviderCollection providers ,
41+ LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
42+ LoggingLevelSwitch levelSwitch = null )
3343 {
3444 if ( configuration == null ) throw new ArgumentNullException ( nameof ( configuration ) ) ;
3545 if ( providers == null ) throw new ArgumentNullException ( nameof ( providers ) ) ;
36- return configuration . Sink ( new LoggerProviderCollectionSink ( providers ) ) ;
46+ return configuration . Sink ( new LoggerProviderCollectionSink ( providers ) , restrictedToMinimumLevel , levelSwitch ) ;
3747 }
3848 }
3949}
0 commit comments