<PackageReference Include="Serilog" Version="4.4.0-dev-02438" />

Serilog.Configuration.LoggerSinkConfiguration

Controls sink configuration.

Helper method for constructing sinks outside of a logger pipeline.

public static LoggerConfiguration Wrap(LoggerSinkConfiguration loggerSinkConfiguration, Func<ILogEventSink, ILogEventSink> wrapSink, Action<LoggerSinkConfiguration> configureWrappedSink, LogEventLevel restrictedToMinimumLevel = 0, LoggingLevelSwitch levelSwitch = null)

Helper method for constructing wrapper sinks.

public static ILogEventSink Wrap(Func<ILogEventSink, ILogEventSink> wrapSink, Action<LoggerSinkConfiguration> configureWrappedSink)

Helper method for constructing wrapper sinks. This may be preferred over CreateSink because it handles delegation of Dispose through to the wrapped sink in cases where the wrapper is not disposable.

Write to a sink only when condition evaluates to true.

public LoggerConfiguration FallbackChain(Action<LoggerSinkConfiguration> configureSink, Action<LoggerSinkConfiguration> configureFallback, Action<LoggerSinkConfiguration>[] configureSubsequentFallbacks)

Write to a sink, and if the sink is unable to record the event, write to a second sink. Additional sinks can be added to the chain if necessary.

public LoggerConfiguration Logger(Action<LoggerConfiguration> configureLogger, LogEventLevel restrictedToMinimumLevel = 0, LoggingLevelSwitch levelSwitch = null)

Write log events to a sub-logger, where further processing may occur. Events through the sub-logger will be constrained by filters and enriched by enrichers that are active in the parent. A sub-logger cannot be used to log at a more verbose level, but a less verbose level is possible.

public LoggerConfiguration Logger(ILogger logger, LogEventLevel restrictedToMinimumLevel)

Write log events to a sub-logger, where further processing may occur. Events through the sub-logger will be constrained by filters and enriched by enrichers that are active in the parent. A sub-logger cannot be used to log at a more verbose level, but a less verbose level is possible.

public LoggerConfiguration Logger(ILogger logger, bool attemptDispose = false, LogEventLevel restrictedToMinimumLevel = 0, LoggingLevelSwitch levelSwitch = null)

Write log events to a sub-logger, where further processing may occur. Events through the sub-logger will be constrained by filters and enriched by enrichers that are active in the parent. A sub-logger cannot be used to log at a more verbose level, but a less verbose level is possible.

public LoggerConfiguration Sink(ILogEventSink logEventSink, LogEventLevel restrictedToMinimumLevel)

Write log events to an ILogEventSink.

public LoggerConfiguration Sink(ILogEventSink logEventSink, LogEventLevel restrictedToMinimumLevel = 0, LoggingLevelSwitch levelSwitch = null)

Write log events to an ILogEventSink.

public LoggerConfiguration Sink<TSink>(LogEventLevel restrictedToMinimumLevel = 0, LoggingLevelSwitch levelSwitch = null) where TSink : ILogEventSink

Write log events to the specified ILogEventSink.

public LoggerConfiguration Sink(IBatchedLogEventSink batchedLogEventSink, BatchingOptions batchingOptions, LogEventLevel restrictedToMinimumLevel = 0, LoggingLevelSwitch levelSwitch = null)

Write log events to an IBatchedLogEventSink. Events will be internally buffered, and written to the sink in batches.

public LoggerConfiguration Sink<TSink>(BatchingOptions batchingOptions, LogEventLevel restrictedToMinimumLevel = 0, LoggingLevelSwitch levelSwitch = null) where TSink : IBatchedLogEventSink