RelationalLoggerExtensions.ConnectionError 方法

定义

ConnectionError事件的日志。

public static void ConnectionError (this Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection> diagnostics, Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, Exception exception, DateTimeOffset startTime, TimeSpan duration, bool logErrorAsDebug);
static member ConnectionError : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection> * Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * Exception * DateTimeOffset * TimeSpan * bool -> unit
<Extension()>
Public Sub ConnectionError (diagnostics As IDiagnosticsLogger(Of DbLoggerCategory.Database.Connection), connection As IRelationalConnection, exception As Exception, startTime As DateTimeOffset, duration As TimeSpan, logErrorAsDebug As Boolean)

参数

diagnostics
IDiagnosticsLogger<DbLoggerCategory.Database.Connection>

要使用的诊断记录器。

connection
IRelationalConnection

连接。

exception
Exception

表示错误的异常。

startTime
DateTimeOffset

开始操作的时间。

duration
TimeSpan

操作失败之前的运行时间。

logErrorAsDebug
Boolean

指示正在处理异常的标志,因此应在调试级别记录该异常。

适用于