Class MessageProcessingLogger
Wraps an with the ability to change its minimum log level at runtime. Decorates log messages using
IDynamicMessageProcessor.
Inheritance
System.Object
MessageProcessingLogger
Assembly: Steeltoe.Logging.Abstractions.dll
Syntax
public class MessageProcessingLogger : ILogger
Constructors
|
Edit this page
View Source
MessageProcessingLogger(ILogger, LoggerFilter, IEnumerable<IDynamicMessageProcessor>)
Declaration
public MessageProcessingLogger(ILogger innerLogger, LoggerFilter filter, IEnumerable<IDynamicMessageProcessor> messageProcessors)
Parameters
Type |
Name |
Description |
ILogger |
innerLogger |
The to wrap.
|
LoggerFilter |
filter |
The filter, which determines whether logging is enabled.
|
IEnumerable<IDynamicMessageProcessor> |
messageProcessors |
The message processors to decorate log messages with.
|
Properties
|
Edit this page
View Source
InnerLogger
Declaration
protected ILogger InnerLogger { get; }
Property Value
|
Edit this page
View Source
MessageProcessors
Declaration
protected IReadOnlyCollection<IDynamicMessageProcessor> MessageProcessors { get; }
Property Value
Methods
|
Edit this page
View Source
BeginScope<TState>(TState)
Declaration
public IDisposable? BeginScope<TState>(TState state)
Parameters
Type |
Name |
Description |
TState |
state |
|
Returns
Type |
Description |
System.Nullable<IDisposable> |
|
Type Parameters
|
Edit this page
View Source
ChangeFilter(LoggerFilter)
Changes the log level filter at runtime.
Declaration
public void ChangeFilter(LoggerFilter filter)
Parameters
Type |
Name |
Description |
LoggerFilter |
filter |
The updated filter, which determines whether logging is enabled.
|
|
Edit this page
View Source
IsEnabled(LogLevel)
Declaration
public bool IsEnabled(LogLevel logLevel)
Parameters
Type |
Name |
Description |
LogLevel |
logLevel |
|
Returns
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
Log<TState>(LogLevel, EventId, TState, Nullable<Exception>, Func<TState, Nullable<Exception>, String>)
Declaration
public virtual void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Parameters
Type |
Name |
Description |
LogLevel |
logLevel |
|
EventId |
eventId |
|
TState |
state |
|
System.Nullable<Exception> |
exception |
|
Func<TState, System.Nullable<Exception>, System.String> |
formatter |
|
Type Parameters