<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="10.0.1-dev-00185" />

Serilog.Sinks.MSSqlServer.MSSqlServerSink

public class MSSqlServerSink : IBatchedLogEventSink, IDisposable
Writes log events as rows in a table of MSSqlServer database.
public const int DefaultBatchPostingLimit = 50

A reasonable default for the number of events posted in each batch.

public static readonly TimeSpan DefaultPeriod

A reasonable default time to wait between checking for event batches.

public const string DefaultSchemaName = "dbo"

The default database schema name.

public MSSqlServerSink(string connectionString, string tableName, int batchPostingLimit, TimeSpan period, IFormatProvider formatProvider, bool autoCreateSqlTable = false, ColumnOptions columnOptions = null, string schemaName = "dbo", ITextFormatter logEventFormatter = null)

Construct a sink posting to the specified database. Note: this is the legacy version of the extension method. Please use the new one using MSSqlServerSinkOptions instead.

public MSSqlServerSink(string connectionString, MSSqlServerSinkOptions sinkOptions, IFormatProvider formatProvider = null, ColumnOptions columnOptions = null, ITextFormatter logEventFormatter = null)

Construct a sink posting to the specified database.

public void Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

protected virtual void Dispose(bool disposing)

Releases the unmanaged resources used by the Serilog.Sinks.MSSqlServer.MSSqlServerAuditSink and optionally releases the managed resources.

public Task EmitBatchAsync(IReadOnlyCollection<LogEvent> batch)

Emit a batch of log events, running asynchronously.

Called upon batchperiod if no data is in batch. Not used by this sink.