20
20
using Serilog . Formatting ;
21
21
using Serilog . Sinks . MSSqlServer ;
22
22
using Serilog . Sinks . MSSqlServer . Configuration . Factories ;
23
- using Serilog . Sinks . MSSqlServer . Sinks . MSSqlServer . Options ;
24
23
25
24
// The "Hybrid" configuration system supports both Microsoft.Extensions.Configuration and System.Configuration.
26
25
// 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
44
43
/// https://gist.github.com/mivano/10429656
45
44
/// or use the autoCreateSqlTable option.
46
45
///
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.
48
47
///
49
48
/// </summary>
50
49
/// <param name="loggerConfiguration">The logger configuration.</param>
@@ -62,7 +61,7 @@ public static class LoggerConfigurationMSSqlServerExtensions
62
61
/// <param name="logEventFormatter">Supplies custom formatter for the LogEvent column, or null</param>
63
62
/// <returns>Logger configuration, allowing configuration to continue.</returns>
64
63
/// <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 ) ]
66
65
public static LoggerConfiguration MSSqlServer (
67
66
this LoggerSinkConfiguration loggerConfiguration ,
68
67
string connectionString ,
@@ -79,9 +78,9 @@ public static LoggerConfiguration MSSqlServer(
79
78
ITextFormatter logEventFormatter = null )
80
79
{
81
80
// 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 .
83
82
84
- var sinkOptions = new SinkOptions ( tableName , batchPostingLimit , period , autoCreateSqlTable , schemaName ) ;
83
+ var sinkOptions = new MSSqlServerSinkOptions ( tableName , batchPostingLimit , period , autoCreateSqlTable , schemaName ) ;
85
84
86
85
return loggerConfiguration . MSSqlServer (
87
86
connectionString : connectionString ,
@@ -116,7 +115,7 @@ public static LoggerConfiguration MSSqlServer(
116
115
public static LoggerConfiguration MSSqlServer (
117
116
this LoggerSinkConfiguration loggerConfiguration ,
118
117
string connectionString ,
119
- SinkOptions sinkOptions = null ,
118
+ MSSqlServerSinkOptions sinkOptions = null ,
120
119
IConfigurationSection sinkOptionsSection = null ,
121
120
IConfiguration appConfiguration = null ,
122
121
LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
@@ -143,7 +142,7 @@ public static LoggerConfiguration MSSqlServer(
143
142
internal static LoggerConfiguration MSSqlServerInternal (
144
143
this LoggerSinkConfiguration loggerConfiguration ,
145
144
string connectionString ,
146
- SinkOptions sinkOptions ,
145
+ MSSqlServerSinkOptions sinkOptions ,
147
146
IConfigurationSection sinkOptionsSection ,
148
147
IConfiguration appConfiguration ,
149
148
LogEventLevel restrictedToMinimumLevel ,
@@ -172,7 +171,7 @@ internal static LoggerConfiguration MSSqlServerInternal(
172
171
/// <summary>
173
172
/// Adds a sink that writes log events to a table in a MSSqlServer database.
174
173
///
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.
176
175
///
177
176
/// </summary>
178
177
/// <param name="loggerAuditSinkConfiguration">The logger configuration.</param>
@@ -188,7 +187,7 @@ internal static LoggerConfiguration MSSqlServerInternal(
188
187
/// <param name="logEventFormatter">Supplies custom formatter for the LogEvent column, or null</param>
189
188
/// <returns>Logger configuration, allowing configuration to continue.</returns>
190
189
/// <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 ) ]
192
191
public static LoggerConfiguration MSSqlServer (
193
192
this LoggerAuditSinkConfiguration loggerAuditSinkConfiguration ,
194
193
string connectionString ,
@@ -203,9 +202,9 @@ public static LoggerConfiguration MSSqlServer(
203
202
ITextFormatter logEventFormatter = null )
204
203
{
205
204
// 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 .
207
206
208
- var sinkOptions = new SinkOptions ( tableName , null , null , autoCreateSqlTable , schemaName ) ;
207
+ var sinkOptions = new MSSqlServerSinkOptions ( tableName , null , null , autoCreateSqlTable , schemaName ) ;
209
208
210
209
return loggerAuditSinkConfiguration . MSSqlServer (
211
210
connectionString : connectionString ,
@@ -237,7 +236,7 @@ public static LoggerConfiguration MSSqlServer(
237
236
public static LoggerConfiguration MSSqlServer (
238
237
this LoggerAuditSinkConfiguration loggerAuditSinkConfiguration ,
239
238
string connectionString ,
240
- SinkOptions sinkOptions = null ,
239
+ MSSqlServerSinkOptions sinkOptions = null ,
241
240
IConfigurationSection sinkOptionsSection = null ,
242
241
IConfiguration appConfiguration = null ,
243
242
LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum ,
@@ -263,7 +262,7 @@ public static LoggerConfiguration MSSqlServer(
263
262
internal static LoggerConfiguration MSSqlServerInternal (
264
263
this LoggerAuditSinkConfiguration loggerAuditSinkConfiguration ,
265
264
string connectionString ,
266
- SinkOptions sinkOptions ,
265
+ MSSqlServerSinkOptions sinkOptions ,
267
266
IConfigurationSection sinkOptionsSection ,
268
267
IConfiguration appConfiguration ,
269
268
LogEventLevel restrictedToMinimumLevel ,
@@ -288,15 +287,15 @@ internal static LoggerConfiguration MSSqlServerInternal(
288
287
289
288
private static void ReadConfiguration (
290
289
ref string connectionString ,
291
- ref SinkOptions sinkOptions ,
290
+ ref MSSqlServerSinkOptions sinkOptions ,
292
291
IConfigurationSection sinkOptionsSection ,
293
292
IConfiguration appConfiguration ,
294
293
ref ColumnOptions columnOptions ,
295
294
IConfigurationSection columnOptionsSection ,
296
295
IApplySystemConfiguration applySystemConfiguration ,
297
296
IApplyMicrosoftExtensionsConfiguration applyMicrosoftExtensionsConfiguration )
298
297
{
299
- sinkOptions = sinkOptions ?? new SinkOptions ( ) ;
298
+ sinkOptions = sinkOptions ?? new MSSqlServerSinkOptions ( ) ;
300
299
columnOptions = columnOptions ?? new ColumnOptions ( ) ;
301
300
302
301
var serviceConfigSection = applySystemConfiguration . GetSinkConfigurationSection ( AppConfigSectionName ) ;
0 commit comments