Share via


IRelationalConnectionDiagnosticsLogger 接口

定义

具有 IDiagnosticsLogger<TLoggerCategory> 一些适用于高性能日志记录的额外功能的 。

public interface IRelationalConnectionDiagnosticsLogger : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection>
type IRelationalConnectionDiagnosticsLogger = interface
    interface IDiagnosticsLogger<DbLoggerCategory.Database.Connection>
    interface IDiagnosticsLogger
Public Interface IRelationalConnectionDiagnosticsLogger
Implements IDiagnosticsLogger(Of DbLoggerCategory.Database.Connection)
实现

注解

服务生存期为 Scoped。 这意味着每个 DbContext 实例都将使用此服务自己的实例。 实现可能依赖于使用任何生存期注册的其他服务。 实现不需要是线程安全的。

有关详细信息 和示例,请参阅数据库提供程序和扩展的实现

属性

DbContextLogger

IDbContextLogger

(继承自 IDiagnosticsLogger)
Definitions

日志记录定义的缓存。

(继承自 IDiagnosticsLogger)
DiagnosticSource

DiagnosticSource

(继承自 IDiagnosticsLogger<TLoggerCategory>)
Interceptors

保留已注册的侦听器(如果有)。

(继承自 IDiagnosticsLogger<TLoggerCategory>)
Logger

基础 ILogger

(继承自 IDiagnosticsLogger<TLoggerCategory>)
Options

实体框架日志记录选项。

(继承自 IDiagnosticsLogger<TLoggerCategory>)

方法

ConnectionClosed(IRelationalConnection, DateTimeOffset, TimeSpan)

ConnectionClosed事件的日志。

ConnectionClosedAsync(IRelationalConnection, DateTimeOffset, TimeSpan)

ConnectionClosed事件的日志。

ConnectionClosing(IRelationalConnection, DateTimeOffset)

ConnectionClosing事件的日志。

ConnectionClosingAsync(IRelationalConnection, DateTimeOffset)

ConnectionClosing事件的日志。

ConnectionCreated(IRelationalConnection, DateTimeOffset, TimeSpan)

ConnectionCreated事件的日志。

ConnectionCreating(IRelationalConnection, DateTimeOffset)

ConnectionCreating事件的日志。

ConnectionDisposed(IRelationalConnection, DateTimeOffset, TimeSpan)

ConnectionDisposed事件的日志。

ConnectionDisposedAsync(IRelationalConnection, DateTimeOffset, TimeSpan)

ConnectionDisposed事件的日志。

ConnectionDisposing(IRelationalConnection, DateTimeOffset)

ConnectionDisposing事件的日志。

ConnectionDisposingAsync(IRelationalConnection, DateTimeOffset)

ConnectionDisposing事件的日志。

ConnectionError(IRelationalConnection, Exception, DateTimeOffset, TimeSpan, Boolean)

ConnectionError事件的日志。

ConnectionErrorAsync(IRelationalConnection, Exception, DateTimeOffset, TimeSpan, Boolean, CancellationToken)

ConnectionError事件的日志。

ConnectionOpened(IRelationalConnection, DateTimeOffset, TimeSpan)

ConnectionOpened事件的日志。

ConnectionOpenedAsync(IRelationalConnection, DateTimeOffset, TimeSpan, CancellationToken)

ConnectionOpened事件的日志。

ConnectionOpening(IRelationalConnection, DateTimeOffset)

ConnectionOpening事件的日志。

ConnectionOpeningAsync(IRelationalConnection, DateTimeOffset, CancellationToken)

ConnectionOpening事件的日志。

DispatchEventData(EventDefinitionBase, EventData, Boolean, Boolean)

将给定 EventData 的 调度到 DiagnosticSource(如果已启用)和 IDbContextLogger(如果已启用)。

(继承自 IDiagnosticsLogger)
GetLogBehavior(EventId, LogLevel)

检查是否已启用给定 logLevel 或给定事件,如果是,则检查是否应记录或引发事件。

(继承自 IDiagnosticsLogger<TLoggerCategory>)
NeedsEventData(EventDefinitionBase, Boolean, Boolean)

EventData根据给定事件是否DiagnosticSource启用了 或 IDbContextLogger ,确定是否需要 实例。

(继承自 IDiagnosticsLogger)
NeedsEventData<TInterceptor>(EventDefinitionBase, TInterceptor, Boolean, Boolean)

EventData根据给定事件是否DiagnosticSource启用了 、 IDbContextLoggerIInterceptor ,确定是否需要实例。

(继承自 IDiagnosticsLogger)
ShouldLog(EventDefinitionBase)

检查是否应将消息发送到 ILogger

(继承自 IDiagnosticsLogger)
ShouldLogConnectionClose(DateTimeOffset)

是否需要 ConnectionClosing 记录 或 ConnectionClosed

ShouldLogConnectionCreate(DateTimeOffset)

是否需要 ConnectionCreating 记录 或 ConnectionCreated

ShouldLogConnectionDispose(DateTimeOffset)

是否需要 ConnectionDisposing 记录 或 ConnectionDisposed

ShouldLogConnectionOpen(DateTimeOffset)

是否需要 ConnectionOpening 记录 或 ConnectionOpened

ShouldLogSensitiveData()

获取一个值,该值指示是否应将敏感信息写入基础记录器。 这也具有在首次记录敏感数据时向日志写入警告的副作用。

(继承自 IDiagnosticsLogger<TLoggerCategory>)

扩展方法

SensitiveDataLoggingEnabledWarning<TLoggerCategory>(IDiagnosticsLogger<TLoggerCategory>)

SensitiveDataLoggingEnabledWarning事件的日志。

适用于