Table of Contents

Class LoggingLevelSwitch

Namespace
Serilog.Core
Assembly
Serilog.dll

Dynamically controls logging level.

public class LoggingLevelSwitch
Inheritance
LoggingLevelSwitch
Inherited Members

Constructors

LoggingLevelSwitch(LogEventLevel)

Create a LoggingLevelSwitch at the initial minimum level.

public LoggingLevelSwitch(LogEventLevel initialMinimumLevel = LogEventLevel.Information)

Parameters

initialMinimumLevel LogEventLevel

The initial level to which the switch is set.

Properties

MinimumLevel

The current minimum level, below which no events should be generated.

public LogEventLevel MinimumLevel { get; set; }

Property Value

LogEventLevel

Events

MinimumLevelChanged

The event arises when MinimumLevel changed. Note that the event is raised under a lock so be careful within event handler to not fall into deadlock.

public event EventHandler<LoggingLevelSwitchChangedEventArgs>? MinimumLevelChanged

Event Type

EventHandler<LoggingLevelSwitchChangedEventArgs>