<PackageReference Include="Serilog.Sinks.PeriodicBatching" Version="4.1.2-dev-00851" />

Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink

public class PeriodicBatchingSink : ILogEventSink, IDisposable, IBatchedLogEventSink
Buffers log events into batches for background flushing.
public const int NoQueueLimit = -1

Constant used with legacy constructor to indicate that the internal queue shouldn't be limited.

Construct a PeriodicBatchingSink.

protected PeriodicBatchingSink(int batchSizeLimit, TimeSpan period)

Construct a PeriodicBatchingSink. New code should avoid subclassing PeriodicBatchingSink and use #ctor instead.

protected PeriodicBatchingSink(int batchSizeLimit, TimeSpan period, int queueLimit)

Construct a PeriodicBatchingSink. New code should avoid subclassing PeriodicBatchingSink and use #ctor instead.

protected virtual bool CanInclude(LogEvent logEvent)

Determine whether a queued log event should be included in the batch. If an override returns false, the event will be dropped.

public void Dispose()

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

protected virtual void Dispose(bool disposing)

Free resources held by the sink.

public void Emit(LogEvent logEvent)

Emit the provided log event to the sink. If the sink is being disposed or the app domain unloaded, then the event is ignored.

protected virtual void EmitBatch(IEnumerable<LogEvent> events)

Emit a batch of log events, running to completion synchronously.

protected virtual Task EmitBatchAsync(IEnumerable<LogEvent> events)

Emit a batch of log events, running asynchronously.

protected virtual void OnEmptyBatch()

Allows derived sinks to perform periodic work without requiring additional threads or timers (thus avoiding additional flush/shut-down complexity).

protected virtual Task OnEmptyBatchAsync()

Allows derived sinks to perform periodic work without requiring additional threads or timers (thus avoiding additional flush/shut-down complexity).