共用方式為


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

事件的標識碼。

state
TState

要寫入的專案。 也可以是物件。

exception
Exception

與這個專案相關的例外狀況。

formatter
Func<TState,Exception,String>

函式,用來建立 stateexceptionString 訊息。

實作

適用於