2020using Serilog . Formatting ;
2121using Serilog . Sinks . MSSqlServer ;
2222using Serilog . Sinks . MSSqlServer . Configuration . Factories ;
23- using Serilog . Sinks . MSSqlServer . Sinks . MSSqlServer . Options ;
2423
2524// The "Hybrid" configuration system supports both Microsoft.Extensions.Configuration and System.Configuration.
2625// This is necessary because .NET Framework 4.6.1+ and .NET Core 2.0+ apps support both approaches, whereas the
@@ -44,7 +43,7 @@ public static class LoggerConfigurationMSSqlServerExtensions
4443 /// https://gist.github.com/mivano/10429656
4544 /// or use the autoCreateSqlTable option.
4645 ///
47- /// Note: this is the legacy version of the extension method. Please use the new one using SinkOptions instead.
46+ /// Note: this is the legacy version of the extension method. Please use the new one using MSSqlServerSinkOptions instead.
4847 ///
4948 /// </summary>
5049 /// <param name="loggerConfiguration">The logger configuration.</param>
@@ -62,7 +61,7 @@ public static class LoggerConfigurationMSSqlServerExtensions
6261 /// <param name="logEventFormatter">Supplies custom formatter for the LogEvent column, or null</param>
6362 /// <returns>Logger configuration, allowing configuration to continue.</returns>
6463 /// <exception cref="ArgumentNullException">A required parameter is null.</exception>
65- [ Obsolete ( "Use the new interface accepting a SinkOptions parameter instead. This will be removed in a future release." , error : false ) ]
64+ [ Obsolete ( "Use the new interface accepting a MSSqlServerSinkOptions parameter instead. This will be removed in a future release." , error : false ) ]
6665 public static LoggerConfiguration MSSqlServer (
6766 this LoggerSinkConfiguration loggerConfiguration ,
6867 string connectionString ,
@@ -79,9 +78,9 @@ public static LoggerConfiguration MSSqlServer(
7978 ITextFormatter logEventFormatter = null )
8079 {
8180 // Do not add new parameters here. This interface is considered legacy and will be deprecated in the future.
82- // For adding new input parameters use the SinkOptions class and the method overload that accepts SinkOptions .
81+ // For adding new input parameters use the MSSqlServerSinkOptions class and the method overload that accepts MSSqlServerSinkOptions .
8382
84- var sinkOptions = new SinkOptions ( tableName , batchPostingLimit , period , autoCreateSqlTable , schemaName ) ;
83+ var sinkOptions = new MSSqlServerSinkOptions ( tableName , batchPostingLimit , period , autoCreateSqlTable , schemaName ) ;
8584
8685 return loggerConfiguration . MSSqlServer (
8786 connectionString : connectionString ,
@@ -116,7 +115,7 @@ public static LoggerConfiguration MSSqlServer(
116115 public static LoggerConfiguration MSSqlServer (
117116 this LoggerSinkConfiguration loggerConfiguration ,
118117 string connectionString ,
119- SinkOptions sinkOptions = null ,
118+ MSSqlServerSinkOptions sinkOptions = null ,
120119 IConfigurationSection sinkOptionsSection = null ,
121120 IConfiguration appConfiguration = null ,
122121 LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
@@ -143,7 +142,7 @@ public static LoggerConfiguration MSSqlServer(
143142 internal static LoggerConfiguration MSSqlServerInternal (
144143 this LoggerSinkConfiguration loggerConfiguration ,
145144 string connectionString ,
146- SinkOptions sinkOptions ,
145+ MSSqlServerSinkOptions sinkOptions ,
147146 IConfigurationSection sinkOptionsSection ,
148147 IConfiguration appConfiguration ,
149148 LogEventLevel restrictedToMinimumLevel ,
@@ -172,7 +171,7 @@ internal static LoggerConfiguration MSSqlServerInternal(
172171 /// <summary>
173172 /// Adds a sink that writes log events to a table in a MSSqlServer database.
174173 ///
175- /// Note: this is the legacy version of the extension method. Please use the new one using SinkOptions instead.
174+ /// Note: this is the legacy version of the extension method. Please use the new one using MSSqlServerSinkOptions instead.
176175 ///
177176 /// </summary>
178177 /// <param name="loggerAuditSinkConfiguration">The logger configuration.</param>
@@ -188,7 +187,7 @@ internal static LoggerConfiguration MSSqlServerInternal(
188187 /// <param name="logEventFormatter">Supplies custom formatter for the LogEvent column, or null</param>
189188 /// <returns>Logger configuration, allowing configuration to continue.</returns>
190189 /// <exception cref="ArgumentNullException">A required parameter is null.</exception>
191- [ Obsolete ( "Use the new interface accepting a SinkOptions parameter instead. This will be removed in a future release." , error : false ) ]
190+ [ Obsolete ( "Use the new interface accepting a MSSqlServerSinkOptions parameter instead. This will be removed in a future release." , error : false ) ]
192191 public static LoggerConfiguration MSSqlServer (
193192 this LoggerAuditSinkConfiguration loggerAuditSinkConfiguration ,
194193 string connectionString ,
@@ -203,9 +202,9 @@ public static LoggerConfiguration MSSqlServer(
203202 ITextFormatter logEventFormatter = null )
204203 {
205204 // Do not add new parameters here. This interface is considered legacy and will be deprecated in the future.
206- // For adding new input parameters use the SinkOptions class and the method overload that accepts SinkOptions .
205+ // For adding new input parameters use the MSSqlServerSinkOptions class and the method overload that accepts MSSqlServerSinkOptions .
207206
208- var sinkOptions = new SinkOptions ( tableName , null , null , autoCreateSqlTable , schemaName ) ;
207+ var sinkOptions = new MSSqlServerSinkOptions ( tableName , null , null , autoCreateSqlTable , schemaName ) ;
209208
210209 return loggerAuditSinkConfiguration . MSSqlServer (
211210 connectionString : connectionString ,
@@ -237,7 +236,7 @@ public static LoggerConfiguration MSSqlServer(
237236 public static LoggerConfiguration MSSqlServer (
238237 this LoggerAuditSinkConfiguration loggerAuditSinkConfiguration ,
239238 string connectionString ,
240- SinkOptions sinkOptions = null ,
239+ MSSqlServerSinkOptions sinkOptions = null ,
241240 IConfigurationSection sinkOptionsSection = null ,
242241 IConfiguration appConfiguration = null ,
243242 LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
@@ -263,7 +262,7 @@ public static LoggerConfiguration MSSqlServer(
263262 internal static LoggerConfiguration MSSqlServerInternal (
264263 this LoggerAuditSinkConfiguration loggerAuditSinkConfiguration ,
265264 string connectionString ,
266- SinkOptions sinkOptions ,
265+ MSSqlServerSinkOptions sinkOptions ,
267266 IConfigurationSection sinkOptionsSection ,
268267 IConfiguration appConfiguration ,
269268 LogEventLevel restrictedToMinimumLevel ,
@@ -288,15 +287,15 @@ internal static LoggerConfiguration MSSqlServerInternal(
288287
289288 private static void ReadConfiguration (
290289 ref string connectionString ,
291- ref SinkOptions sinkOptions ,
290+ ref MSSqlServerSinkOptions sinkOptions ,
292291 IConfigurationSection sinkOptionsSection ,
293292 IConfiguration appConfiguration ,
294293 ref ColumnOptions columnOptions ,
295294 IConfigurationSection columnOptionsSection ,
296295 IApplySystemConfiguration applySystemConfiguration ,
297296 IApplyMicrosoftExtensionsConfiguration applyMicrosoftExtensionsConfiguration )
298297 {
299- sinkOptions = sinkOptions ?? new SinkOptions ( ) ;
298+ sinkOptions = sinkOptions ?? new MSSqlServerSinkOptions ( ) ;
300299 columnOptions = columnOptions ?? new ColumnOptions ( ) ;
301300
302301 var serviceConfigSection = applySystemConfiguration . GetSinkConfigurationSection ( AppConfigSectionName ) ;
0 commit comments