Logger<T>.ILogger.Log<TState> 方法

定义

写入日志条目。

generic <typename TState>
 virtual void Microsoft.Extensions.Logging.ILogger.Log(Microsoft::Extensions::Logging::LogLevel logLevel, Microsoft::Extensions::Logging::EventId eventId, TState state, Exception ^ exception, Func<TState, Exception ^, System::String ^> ^ formatter) = Microsoft::Extensions::Logging::ILogger::Log;
void ILogger.Log<TState> (Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, TState state, Exception exception, Func<TState,Exception,string> formatter);
abstract member Microsoft.Extensions.Logging.ILogger.Log : Microsoft.Extensions.Logging.LogLevel * Microsoft.Extensions.Logging.EventId * 'State * Exception * Func<'State, Exception, string> -> unit
override this.Microsoft.Extensions.Logging.ILogger.Log : Microsoft.Extensions.Logging.LogLevel * Microsoft.Extensions.Logging.EventId * 'State * Exception * Func<'State, Exception, string> -> unit
Sub Log(Of TState) (logLevel As LogLevel, eventId As EventId, state As TState, exception As Exception, formatter As Func(Of TState, Exception, String)) Implements ILogger.Log

类型参数

TState

要写入的对象的类型。

参数

logLevel
LogLevel

条目将在此级别写入。

eventId
EventId

事件的 ID。

state
TState

要写入的条目。 也可以是对象。

exception
Exception

与此条目相关的异常。

formatter
Func<TState,Exception,String>

用于创建 stateexceptionString 消息的函数。

实现

适用于