Logger<T> 类

定义

使用由提供的 ILoggerFactory 创建的给定类型的全名委托给新的 ILogger 实例。Delegates to a new ILogger instance using the full name of the given type, created by the provided ILoggerFactory.

generic <typename T>
public ref class Logger : Microsoft::Extensions::Logging::ILogger<T>
public class Logger<T> : Microsoft.Extensions.Logging.ILogger<T>
type Logger<'T> = class
    interface ILogger<'T>
    interface ILogger
type Logger<'T> = class
    interface ILogger
    interface ILogger<'T>
Public Class Logger(Of T)
Implements ILogger(Of T)

类型参数

T

类型。The type.

继承
Logger<T>
实现

构造函数

Logger<T>(ILoggerFactory)

创建一个新的 Logger<T>Creates a new Logger<T>.

方法

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

显式接口实现

ILogger.BeginScope<TState>(TState)

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

ILogger.IsEnabled(LogLevel)

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

ILogger.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.

适用于