Table of Contents

Class LoggerMinimumLevelConfiguration

Namespace
Serilog.Configuration
Assembly
Serilog.dll

Controls sink configuration.

public class LoggerMinimumLevelConfiguration
Inheritance
LoggerMinimumLevelConfiguration
Inherited Members

Methods

ControlledBy(LoggingLevelSwitch)

Sets the minimum level to be dynamically controlled by the provided switch.

public LoggerConfiguration ControlledBy(LoggingLevelSwitch levelSwitch)

Parameters

levelSwitch LoggingLevelSwitch

The switch.

Returns

LoggerConfiguration

Configuration object allowing method chaining.

Exceptions

ArgumentNullException

When levelSwitch is

null

Debug()

Internal system events that aren't necessarily observable from the outside.

public LoggerConfiguration Debug()

Returns

LoggerConfiguration

Configuration object allowing method chaining.

Error()

Functionality is unavailable, invariants are broken or data is lost.

public LoggerConfiguration Error()

Returns

LoggerConfiguration

Configuration object allowing method chaining.

Fatal()

If you have a pager, it goes off when one of these occurs.

public LoggerConfiguration Fatal()

Returns

LoggerConfiguration

Configuration object allowing method chaining.

Information()

The lifeblood of operational intelligence - things happen.

public LoggerConfiguration Information()

Returns

LoggerConfiguration

Configuration object allowing method chaining.

Is(LogEventLevel)

Sets the minimum level at which events will be passed to sinks.

public LoggerConfiguration Is(LogEventLevel minimumLevel)

Parameters

minimumLevel LogEventLevel

The minimum level to set.

Returns

LoggerConfiguration

Configuration object allowing method chaining.

Override(string, LoggingLevelSwitch)

Override the minimum level for events from a specific namespace or type name. This API is not supported for configuring sub-loggers (created through Logger(ILogger, LogEventLevel)). Use Filter or Conditional(Func<LogEvent, bool>, Action<LoggerSinkConfiguration>) instead. You also might consider using https://github.com/serilog/serilog-filters-expressions.

public LoggerConfiguration Override(string source, LoggingLevelSwitch levelSwitch)

Parameters

source string

The (partial) namespace or type name to set the override for.

levelSwitch LoggingLevelSwitch

The switch controlling loggers for matching sources.

Returns

LoggerConfiguration

Configuration object allowing method chaining.

Exceptions

ArgumentNullException

When source is

null
ArgumentException

When a trimmed source is empty

ArgumentNullException

When levelSwitch is

null

Override(string, LogEventLevel)

Override the minimum level for events from a specific namespace or type name. This API is not supported for configuring sub-loggers (created through Logger(ILogger, LogEventLevel)). Use Filter or Conditional(Func<LogEvent, bool>, Action<LoggerSinkConfiguration>) instead. You also might consider using https://github.com/serilog/serilog-filters-expressions.

public LoggerConfiguration Override(string source, LogEventLevel minimumLevel)

Parameters

source string

The (partial) namespace or type name to set the override for.

minimumLevel LogEventLevel

The minimum level applied to loggers for matching sources.

Returns

LoggerConfiguration

Configuration object allowing method chaining.

Exceptions

ArgumentNullException

When source is

null

Verbose()

Anything and everything you might want to know about a running block of code.

public LoggerConfiguration Verbose()

Returns

LoggerConfiguration

Configuration object allowing method chaining.

Warning()

Service is degraded or endangered.

public LoggerConfiguration Warning()

Returns

LoggerConfiguration

Configuration object allowing method chaining.