src/Serilog.Sinks.MSSqlServer/Configuration/Extensions/System.Configuration/LoggerConfigurationMSSqlServerExtensions.cs
/// <summary>
/// Adds a sink that writes log events to a table in a MSSqlServer database.
/// Create a database and execute the table creation script found here
/// https://gist.github.com/mivano/10429656
/// or use the autoCreateSqlTable option.
/// </summary>
/// <param name="loggerAuditSinkConfiguration">The logger configuration.</param>
/// <param name="connectionString">The connection string to the database where to store the events.</param>
/// <param name="sinkOptions">Supplies additional settings for the sink</param>
/// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
/// <param name="formatProvider">Supplies culture-specific formatting information, or null.</param>
/// <param name="columnOptions"></param>
/// <param name="logEventFormatter">Supplies custom formatter for the LogEvent column, or null</param>
/// <returns>Logger configuration, allowing configuration to continue.</returns>
/// <exception cref="ArgumentNullException">A required parameter is null.</exception>
Adds a sink that writes log events to a table in a MSSqlServer database.
Adds a sink that writes log events to a table in a MSSqlServer database .
public static LoggerConfiguration MSSqlServer(
            this LoggerAuditSinkConfiguration loggerAuditSinkConfiguration,
            string connectionString,
            SinkOptions sinkOptions = null,
            LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum,
            IFormatProvider formatProvider = null,
            ColumnOptions columnOptions = null,
            ITextFormatter logEventFormatter = null) =>
            loggerAuditSinkConfiguration.MSSqlServerInternal(
                configSectionName: AppConfigSectionName,
                connectionString: connectionString,
                sinkOptions: sinkOptions,
                restrictedToMinimumLevel: restrictedToMinimumLevel,
                formatProvider: formatProvider,
                columnOptions: columnOptions,
                logEventFormatter: logEventFormatter,
                applySystemConfiguration: new ApplySystemConfiguration(),
                auditSinkFactory: new MSSqlServerAuditSinkFactory());
public static LoggerConfiguration MSSqlServer ( this LoggerAuditSinkConfiguration loggerAuditSinkConfiguration , string connectionString , SinkOptions sinkOptions = null , LogEventLevel restrictedToMinimumLevel = LevelAlias . Minimum , IFormatProvider formatProvider = null , ColumnOptions columnOptions = null , ITextFormatter logEventFormatter = null ) => loggerAuditSinkConfiguration . MSSqlServerInternal ( configSectionName : AppConfigSectionName , connectionString : connectionString , sinkOptions : sinkOptions , restrictedToMinimumLevel : restrictedToMinimumLevel , formatProvider : formatProvider , columnOptions : columnOptions , logEventFormatter : logEventFormatter , applySystemConfiguration : new ApplySystemConfiguration ( ) , auditSinkFactory : new MSSqlServerAuditSinkFactory ( ) ) ;
Adds a sink that writes log events to a table in a MSSqlServer database.
Adds a sink that writes log events to a table in a MSSqlServer database .
Logger configuration, allowing configuration to continue.
Logger configuration allowing configuration to continue .
A required parameter is null.
A required parameter is null .
LoggerAuditSinkConfiguration
this
connectionString
string
The connection string to the database where to store the events.
The connection string to the database where to store the events .
sinkOptions
SinkOptions
Supplies additional settings for the sink
Supplies additional settings for the sink
restrictedToMinimumLevel
LogEventLevel
The minimum log event level required in order to write an event to the sink.
The minimum log event level required in order to write an event to the sink .
formatProvider
IFormatProvider
Supplies culture-specific formatting information, or null.
Supplies culture - specific formatting information or null .
columnOptions
ColumnOptions
None
logEventFormatter
ITextFormatter
Supplies custom formatter for the LogEvent column, or null
Supplies custom formatter for the LogEvent column or null
loggerAuditSinkConfiguration
The logger configuration.
The logger configuration .