RelationalLoggerExtensions.ConnectionErrorAsync 方法

定义

ConnectionError事件的日志。

public static System.Threading.Tasks.Task ConnectionErrorAsync (this Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection> diagnostics, Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, Exception exception, DateTimeOffset startTime, TimeSpan duration, bool logErrorAsDebug, System.Threading.CancellationToken cancellationToken = default);
static member ConnectionErrorAsync : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection> * Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * Exception * DateTimeOffset * TimeSpan * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function ConnectionErrorAsync (diagnostics As IDiagnosticsLogger(Of DbLoggerCategory.Database.Connection), connection As IRelationalConnection, exception As Exception, startTime As DateTimeOffset, duration As TimeSpan, logErrorAsDebug As Boolean, Optional cancellationToken As CancellationToken = Nothing) As Task

参数

diagnostics
IDiagnosticsLogger<DbLoggerCategory.Database.Connection>

要使用的诊断记录器。

connection
IRelationalConnection

连接。

exception
Exception

表示错误的异常。

startTime
DateTimeOffset

开始操作的时间。

duration
TimeSpan

操作失败之前的已用时间。

logErrorAsDebug
Boolean

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

cancellationToken
CancellationToken

取消标记。

返回

表示 Task 异步操作的 。

适用于