Interface IBatchedLogEventSink
A destination that accepts events in batches. Many sinks gain a performance advantage by handling events in batches, for example to combine multiple events into a single network request to a remote collector. Because the client application cannot wait for every event to be flushed when batching is used, batched sinks normally work asynchronously to conserve local resources while batches are sent.
public interface IBatchedLogEventSink
Methods
EmitBatchAsync(IReadOnlyCollection<LogEvent>)
Emit a batch of log events, asynchronously.
Task EmitBatchAsync(IReadOnlyCollection<LogEvent> batch)
Parameters
batch
IReadOnlyCollection<LogEvent>The batch of events to emit.
Returns
Remarks
Implementers should allow exceptions to propagate when batches fail. The batching infrastructure handles exception handling, diagnostics, and retries.
- See Also
OnEmptyBatchAsync()
Allows sinks to perform periodic work without requiring additional threads or timers (thus avoiding additional flush/shut-down complexity).
Task OnEmptyBatchAsync()
Returns
- See Also