BatchingLogger.Log 方法

定义

重载

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

写入日志项。

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

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

写入日志项。

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

类型参数

TState

参数

logLevel
LogLevel

将在此级别上写入项。

eventId
EventId

事件的 ID。

state
TState

要写入的项。 也可以是对象。

exception
Exception

与此项相关的异常。

formatter
Func<TState,Exception,String>

函数,用于创建 stateexceptionString 消息。

实现

适用于

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

public:
generic <typename TState>
 void Log(DateTimeOffset timestamp, Microsoft::Extensions::Logging::LogLevel logLevel, Microsoft::Extensions::Logging::EventId eventId, TState state, Exception ^ exception, Func<TState, Exception ^, System::String ^> ^ formatter);
public void Log<TState> (DateTimeOffset timestamp, Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, TState state, Exception exception, Func<TState,Exception,string> formatter);
member this.Log : DateTimeOffset * Microsoft.Extensions.Logging.LogLevel * Microsoft.Extensions.Logging.EventId * 'State * Exception * Func<'State, Exception, string> -> unit
Public Sub Log(Of TState) (timestamp As DateTimeOffset, logLevel As LogLevel, eventId As EventId, state As TState, exception As Exception, formatter As Func(Of TState, Exception, String))

类型参数

TState

参数

timestamp
DateTimeOffset
logLevel
LogLevel
eventId
EventId
state
TState
exception
Exception
formatter
Func<TState,Exception,String>

适用于