ILogger 接口

定义

表示用于执行日志记录的类型。Represents a type used to perform logging.

public interface class ILogger
public interface ILogger
type ILogger = interface
Public Interface ILogger
派生

注解

将大多数日志记录模式聚合成一个方法。Aggregates most logging patterns to a single method.

方法

BeginScope<TState>(TState)

开始逻辑操作范围。Begins a logical operation scope.

IsEnabled(LogLevel)

检查是否已启用给定 logLevelChecks if the given logLevel is enabled.

Log<TState>(LogLevel, EventId, TState, Exception, Func<TState,Exception,String>)

写入日志项。Writes a log entry.

扩展方法

BeginScope(ILogger, String, Object[])

设置消息格式并创建范围。Formats the message and creates a scope.

Log(ILogger, LogLevel, EventId, Exception, String, Object[])

在指定的日志级别设置日志消息格式并写入该消息。Formats and writes a log message at the specified log level.

Log(ILogger, LogLevel, EventId, String, Object[])

在指定的日志级别设置日志消息格式并写入该消息。Formats and writes a log message at the specified log level.

Log(ILogger, LogLevel, Exception, String, Object[])

在指定的日志级别设置日志消息格式并写入该消息。Formats and writes a log message at the specified log level.

Log(ILogger, LogLevel, String, Object[])

在指定的日志级别设置日志消息格式并写入该消息。Formats and writes a log message at the specified log level.

LogCritical(ILogger, EventId, Exception, String, Object[])

设置关键日志消息格式并写入该消息。Formats and writes a critical log message.

LogCritical(ILogger, EventId, String, Object[])

设置关键日志消息格式并写入该消息。Formats and writes a critical log message.

LogCritical(ILogger, Exception, String, Object[])

设置关键日志消息格式并写入该消息。Formats and writes a critical log message.

LogCritical(ILogger, String, Object[])

设置关键日志消息格式并写入该消息。Formats and writes a critical log message.

LogDebug(ILogger, EventId, Exception, String, Object[])

设置调试日志消息格式并写入该消息。Formats and writes a debug log message.

LogDebug(ILogger, EventId, String, Object[])

设置调试日志消息格式并写入该消息。Formats and writes a debug log message.

LogDebug(ILogger, Exception, String, Object[])

设置调试日志消息格式并写入该消息。Formats and writes a debug log message.

LogDebug(ILogger, String, Object[])

设置调试日志消息格式并写入该消息。Formats and writes a debug log message.

LogError(ILogger, EventId, Exception, String, Object[])

设置错误日志消息格式并写入该消息。Formats and writes an error log message.

LogError(ILogger, EventId, String, Object[])

设置错误日志消息格式并写入该消息。Formats and writes an error log message.

LogError(ILogger, Exception, String, Object[])

设置错误日志消息格式并写入该消息。Formats and writes an error log message.

LogError(ILogger, String, Object[])

设置错误日志消息格式并写入该消息。Formats and writes an error log message.

LogInformation(ILogger, EventId, Exception, String, Object[])

设置信息日志消息格式并写入该消息。Formats and writes an informational log message.

LogInformation(ILogger, EventId, String, Object[])

设置信息日志消息格式并写入该消息。Formats and writes an informational log message.

LogInformation(ILogger, Exception, String, Object[])

设置信息日志消息格式并写入该消息。Formats and writes an informational log message.

LogInformation(ILogger, String, Object[])

设置信息日志消息格式并写入该消息。Formats and writes an informational log message.

LogTrace(ILogger, EventId, Exception, String, Object[])

设置跟踪日志消息格式并写入该消息。Formats and writes a trace log message.

LogTrace(ILogger, EventId, String, Object[])

设置跟踪日志消息格式并写入该消息。Formats and writes a trace log message.

LogTrace(ILogger, Exception, String, Object[])

设置跟踪日志消息格式并写入该消息。Formats and writes a trace log message.

LogTrace(ILogger, String, Object[])

设置跟踪日志消息格式并写入该消息。Formats and writes a trace log message.

LogWarning(ILogger, EventId, Exception, String, Object[])

设置警告日志消息格式并写入该消息。Formats and writes a warning log message.

LogWarning(ILogger, EventId, String, Object[])

设置警告日志消息格式并写入该消息。Formats and writes a warning log message.

LogWarning(ILogger, Exception, String, Object[])

设置警告日志消息格式并写入该消息。Formats and writes a warning log message.

LogWarning(ILogger, String, Object[])

设置警告日志消息格式并写入该消息。Formats and writes a warning log message.

适用于