Class MicrosoftExtensionsLoggingLogger
- Namespace
- Splat.Microsoft.Extensions.Logging
- Assembly
- Splat.Microsoft.Extensions.Logging.dll
Provides an adapter that wraps a Microsoft.Extensions.Logging.ILogger instance for use with the ILogger interface.
public sealed class MicrosoftExtensionsLoggingLogger : ILogger
- Inheritance
-
MicrosoftExtensionsLoggingLogger
- Implements
-
ILogger
- Extension Methods
Remarks
This class enables integration between components expecting an ILogger implementation and the Microsoft.Extensions.Logging infrastructure. It delegates all logging operations to the underlying Microsoft.Extensions.Logging.ILogger instance supplied at construction. Thread safety and log level filtering are determined by the behavior of the wrapped logger.
Constructors
MicrosoftExtensionsLoggingLogger(ILogger)
Initializes a new instance of the MicrosoftExtensionsLoggingLogger class.
public MicrosoftExtensionsLoggingLogger(ILogger inner)
Parameters
innerILoggerThe Microsoft.Extensions.Logging logger instance to wrap.
Properties
Level
Gets the level at which the target will emit messages.
public LogLevel Level { get; }
Property Value
- LogLevel
Methods
Write(Exception, string, LogLevel)
Writes a message to the target.
public void Write(Exception exception, string message, LogLevel logLevel)
Parameters
exceptionExceptionThe exception that occurred.
messagestringThe message to write.
logLevelLogLevelThe severity level of the log message.
Write(Exception, string, Type, LogLevel)
Writes a message to the target.
public void Write(Exception exception, string message, Type type, LogLevel logLevel)
Parameters
exceptionExceptionThe exception that occurred.
messagestringThe message to write.
typeTypeThe type associated with the log message.
logLevelLogLevelThe severity level of the log message.
Write(string, LogLevel)
Writes a message to the target.
public void Write(string message, LogLevel logLevel)
Parameters
messagestringThe message to write.
logLevelLogLevelThe severity level of the log message.
Write(string, Type, LogLevel)
Writes a message to the target.
public void Write(string message, Type type, LogLevel logLevel)