EventDefinitionBase.GetLogBehavior<TLoggerCategory> 方法

定义

获取此事件的日志行为。 这将确定是应记录、作为异常引发还是忽略它。

public virtual Microsoft.EntityFrameworkCore.WarningBehavior GetLogBehavior<TLoggerCategory> (Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<TLoggerCategory> logger) where TLoggerCategory : Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<TLoggerCategory>, new();
abstract member GetLogBehavior : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<'LoggerCategory (requires 'LoggerCategory :> Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<'LoggerCategory> and 'LoggerCategory : (new : unit -> 'LoggerCategory))> -> Microsoft.EntityFrameworkCore.WarningBehavior (requires 'LoggerCategory :> Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<'LoggerCategory> and 'LoggerCategory : (new : unit -> 'LoggerCategory))
override this.GetLogBehavior : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<'LoggerCategory (requires 'LoggerCategory :> Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<'LoggerCategory> and 'LoggerCategory : (new : unit -> 'LoggerCategory))> -> Microsoft.EntityFrameworkCore.WarningBehavior (requires 'LoggerCategory :> Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<'LoggerCategory> and 'LoggerCategory : (new : unit -> 'LoggerCategory))
Public Overridable Function GetLogBehavior(Of TLoggerCategory As {LoggerCategory(Of TLoggerCategory)New}) (logger As IDiagnosticsLogger(Of TLoggerCategory)) As WarningBehavior

类型参数

TLoggerCategory

DbLoggerCategory

参数

logger
IDiagnosticsLogger<TLoggerCategory>

要记录事件的记录器。

返回

是应记录事件、作为异常引发还是忽略事件。

适用于