Class DynamicConsoleLogger
- Namespace
- Steeltoe.Extensions.Logging
- Assembly
- Steeltoe.Extensions.Logging.DynamicLogger.dll
public class DynamicConsoleLogger : ILogger
- Inheritance
-
DynamicConsoleLogger
- Implements
- Inherited Members
- Extension Methods
Properties
Delegate
public ILogger Delegate { get; }
Property Value
Filter
public Func<string, LogLevel, bool> Filter { get; }
Property Value
Name
public string Name { get; }
Property Value
Methods
BeginScope<TState>(TState)
Begins a logical operation scope.
public IDisposable BeginScope<TState>(TState state)
Parameters
stateTStateThe identifier for the scope.
Returns
- IDisposable
An IDisposable that ends the logical operation scope on dispose.
Type Parameters
TState
IsEnabled(LogLevel)
Checks if the given logLevel is enabled.
public bool IsEnabled(LogLevel logLevel)
Parameters
logLevelLogLevellevel to be checked.
Returns
- bool
trueif enabled.
Log<TState>(LogLevel, EventId, TState, Exception, Func<TState, Exception, string>)
Writes a log entry.
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Parameters
logLevelLogLevelEntry will be written on this level.
eventIdEventIdId of the event.
stateTStateThe entry to be written. Can be also an object.
exceptionExceptionThe exception related to this entry.
formatterFunc<TState, Exception, string>Function to create a
stringmessage of thestateandexception.
Type Parameters
TState
WriteMessage(LogLevel, string, int, string, Exception)
public virtual void WriteMessage(LogLevel logLevel, string logName, int eventId, string message, Exception exception)