Class LogLevelConfigurator
Configure and stores the LogLevel overrides.
Inherited Members
Namespace: Silverback.Diagnostics
Assembly: Silverback.Core.dll
Syntax
public sealed class LogLevelConfigurator
Constructors
LogLevelConfigurator()
Configure and stores the LogLevel overrides.
Declaration
public LogLevelConfigurator()
Methods
SetLogLevel(EventId, LogLevel)
Configure the log level that should be applied to the specified event.
Declaration
public LogLevelConfigurator SetLogLevel(EventId eventId, LogLevel logLevel)
Parameters
| Type | Name | Description |
|---|---|---|
| EventId | eventId | The event id. |
| LogLevel | logLevel | The log level to apply. |
Returns
| Type | Description |
|---|---|
| LogLevelConfigurator | The LogLevelConfigurator so that additional calls can be chained. |
SetLogLevel(EventId, Func<Exception?, LogLevel, LogLevel>)
Configure a delegate that determines the log level that should be applied to the specified event.
Declaration
public LogLevelConfigurator SetLogLevel(EventId eventId, Func<Exception?, LogLevel, LogLevel> logLevelFunc)
Parameters
| Type | Name | Description |
|---|---|---|
| EventId | eventId | The event id. |
| Func<Exception, LogLevel, LogLevel> | logLevelFunc | The function that returns the log level. It takes the logged exception and the default log level as parameters. |
Returns
| Type | Description |
|---|---|
| LogLevelConfigurator | The LogLevelConfigurator so that additional calls can be chained. |
SetLogLevel(EventId, Func<Exception?, LogLevel, Lazy<string>, LogLevel>)
Configure a delegate that determines the log level that should be applied to the specified event.
Declaration
public LogLevelConfigurator SetLogLevel(EventId eventId, Func<Exception?, LogLevel, Lazy<string>, LogLevel> logLevelFunc)
Parameters
| Type | Name | Description |
|---|---|---|
| EventId | eventId | The event id. |
| Func<Exception, LogLevel, Lazy<string>, LogLevel> | logLevelFunc | The function that returns the log level. It takes the logged exception, the message and the default log level as parameters. |
Returns
| Type | Description |
|---|---|
| LogLevelConfigurator | The LogLevelConfigurator so that additional calls can be chained. |