Interface ILogContext
Represents a logging context that provides methods for creating sub-contexts, retrieving loggers, emitting log messages, and configuring minimum log levels.
public interface ILogContext : IDisposable
- Inherited Members
Properties
Handlers
Gets a list of log handlers.
ILogHandlerList Handlers { get; }
Property Value
Methods
CreateContext()
Creates a new logging context.
ILogContext CreateContext()
Returns
- ILogContext
A new instance of ILogContext.
CreateContext(LogEventLevel)
Creates a new logging context with the specified minimum log level.
ILogContext CreateContext(LogEventLevel minimumLevel)
Parameters
minimumLevel
LogEventLevelThe minimum log level for the new context.
Returns
- ILogContext
A new instance of ILogContext with the specified minimum log level.
SetLevel(LogEventLevel)
Sets the minimum log level for the current context.
ILogContext SetLevel(LogEventLevel level)
Parameters
level
LogEventLevelThe minimum log level.
Returns
- ILogContext
The current instance of ILogContext with the minimum log level set.
SetLevel(Type, LogEventLevel)
Sets the minimum log level for the specified type in the current context.
ILogContext SetLevel(Type issuer, LogEventLevel level)
Parameters
issuer
TypeThe type for which to set the minimum log level.
level
LogEventLevelThe minimum log level.
Returns
- ILogContext
The current instance of ILogContext with the minimum log level set for the specified type.