Share via


IRelationalCommandDiagnosticsLogger Interface

Definition

An IDiagnosticsLogger<TLoggerCategory> with some extra functionality suited for high-performance logging.

public interface IRelationalCommandDiagnosticsLogger : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command>
type IRelationalCommandDiagnosticsLogger = interface
    interface IDiagnosticsLogger<DbLoggerCategory.Database.Command>
    interface IDiagnosticsLogger
Public Interface IRelationalCommandDiagnosticsLogger
Implements IDiagnosticsLogger(Of DbLoggerCategory.Database.Command)
Implements

Remarks

The service lifetime is Scoped. This means that each DbContext instance will use its own instance of this service. The implementation may depend on other services registered with any lifetime. The implementation does not need to be thread-safe.

See Implementation of database providers and extensions for more information and examples.

Properties

DbContextLogger

The IDbContextLogger.

(Inherited from IDiagnosticsLogger)
Definitions

Caching for logging definitions.

(Inherited from IDiagnosticsLogger)
DiagnosticSource

The DiagnosticSource.

(Inherited from IDiagnosticsLogger<TLoggerCategory>)
Interceptors

Holds registered interceptors, if any.

(Inherited from IDiagnosticsLogger<TLoggerCategory>)
Logger

The underlying ILogger.

(Inherited from IDiagnosticsLogger<TLoggerCategory>)
Options

Entity Framework logging options.

(Inherited from IDiagnosticsLogger<TLoggerCategory>)

Methods

CommandCanceled(IRelationalConnection, DbCommand, DbContext, DbCommandMethod, Guid, Guid, DateTimeOffset, TimeSpan, CommandSource)

Logs for the CommandCanceled event.

CommandCanceledAsync(IRelationalConnection, DbCommand, DbContext, DbCommandMethod, Guid, Guid, DateTimeOffset, TimeSpan, CommandSource, CancellationToken)

Logs for the CommandCanceled event.

CommandCreated(IRelationalConnection, DbCommand, DbCommandMethod, DbContext, Guid, Guid, DateTimeOffset, TimeSpan, CommandSource)

Logs for the CommandCreated event.

CommandCreating(IRelationalConnection, DbCommandMethod, DbContext, Guid, Guid, DateTimeOffset, CommandSource)

Logs for the CommandCreating event.

CommandError(IRelationalConnection, DbCommand, DbContext, DbCommandMethod, Guid, Guid, Exception, DateTimeOffset, TimeSpan, CommandSource)

Logs for the CommandError event.

CommandErrorAsync(IRelationalConnection, DbCommand, DbContext, DbCommandMethod, Guid, Guid, Exception, DateTimeOffset, TimeSpan, CommandSource, CancellationToken)

Logs for the CommandError event.

CommandInitialized(IRelationalConnection, DbCommand, DbCommandMethod, DbContext, Guid, Guid, DateTimeOffset, TimeSpan, CommandSource)

Logs for the CommandInitialized event.

CommandNonQueryExecuted(IRelationalConnection, DbCommand, DbContext, Guid, Guid, Int32, DateTimeOffset, TimeSpan, CommandSource)

Logs for the CommandExecuted event.

CommandNonQueryExecutedAsync(IRelationalConnection, DbCommand, DbContext, Guid, Guid, Int32, DateTimeOffset, TimeSpan, CommandSource, CancellationToken)

Logs for the CommandExecuted event.

CommandNonQueryExecuting(IRelationalConnection, DbCommand, DbContext, Guid, Guid, DateTimeOffset, CommandSource)

Logs for the CommandExecuting event.

CommandNonQueryExecutingAsync(IRelationalConnection, DbCommand, DbContext, Guid, Guid, DateTimeOffset, CommandSource, CancellationToken)

Logs for the CommandExecuting event.

CommandReaderExecuted(IRelationalConnection, DbCommand, DbContext, Guid, Guid, DbDataReader, DateTimeOffset, TimeSpan, CommandSource)

Logs for the CommandExecuted event.

CommandReaderExecutedAsync(IRelationalConnection, DbCommand, DbContext, Guid, Guid, DbDataReader, DateTimeOffset, TimeSpan, CommandSource, CancellationToken)

Logs for the CommandExecuted event.

CommandReaderExecuting(IRelationalConnection, DbCommand, DbContext, Guid, Guid, DateTimeOffset, CommandSource)

Logs for the CommandExecuting event.

CommandReaderExecutingAsync(IRelationalConnection, DbCommand, DbContext, Guid, Guid, DateTimeOffset, CommandSource, CancellationToken)

Logs for the CommandExecuting event.

CommandScalarExecuted(IRelationalConnection, DbCommand, DbContext, Guid, Guid, Object, DateTimeOffset, TimeSpan, CommandSource)

Logs for the CommandExecuted event.

CommandScalarExecutedAsync(IRelationalConnection, DbCommand, DbContext, Guid, Guid, Object, DateTimeOffset, TimeSpan, CommandSource, CancellationToken)

Logs for the CommandExecuted event.

CommandScalarExecuting(IRelationalConnection, DbCommand, DbContext, Guid, Guid, DateTimeOffset, CommandSource)

Logs for the CommandExecuting event.

CommandScalarExecutingAsync(IRelationalConnection, DbCommand, DbContext, Guid, Guid, DateTimeOffset, CommandSource, CancellationToken)

Logs for the CommandExecuting event.

DataReaderClosing(IRelationalConnection, DbCommand, DbDataReader, Guid, Int32, Int32, DateTimeOffset)

Logs for the DataReaderClosing event.

DataReaderClosingAsync(IRelationalConnection, DbCommand, DbDataReader, Guid, Int32, Int32, DateTimeOffset)

Logs for the DataReaderClosing event.

DataReaderDisposing(IRelationalConnection, DbCommand, DbDataReader, Guid, Int32, Int32, DateTimeOffset, TimeSpan)

Logs for the DataReaderDisposing event.

DispatchEventData(EventDefinitionBase, EventData, Boolean, Boolean)

Dispatches the given EventData to a DiagnosticSource, if enabled, and a IDbContextLogger, if enabled.

(Inherited from IDiagnosticsLogger)
GetLogBehavior(EventId, LogLevel)

Checks if the given logLevel is enabled or the given event, and, if so, whether the event should be logged or thrown.

(Inherited from IDiagnosticsLogger<TLoggerCategory>)
NeedsEventData(EventDefinitionBase, Boolean, Boolean)

Determines whether or not an EventData instance is needed based on whether or not there is a DiagnosticSource or an IDbContextLogger enabled for the given event.

(Inherited from IDiagnosticsLogger)
NeedsEventData<TInterceptor>(EventDefinitionBase, TInterceptor, Boolean, Boolean)

Determines whether or not an EventData instance is needed based on whether or not there is a DiagnosticSource, an IDbContextLogger, or an IInterceptor enabled for the given event.

(Inherited from IDiagnosticsLogger)
ShouldLog(EventDefinitionBase)

Checks whether or not the message should be sent to the ILogger.

(Inherited from IDiagnosticsLogger)
ShouldLogCommandCreate(DateTimeOffset)

Whether CommandCreating or CommandCreated need to be logged.

ShouldLogCommandExecute(DateTimeOffset)

Whether CommandExecuting or CommandExecuted need to be logged.

ShouldLogDataReaderClose(DateTimeOffset)

Whether DataReaderClosing needs to be logged.

ShouldLogDataReaderDispose(DateTimeOffset)

Whether DataReaderDisposing needs to be logged.

ShouldLogSensitiveData()

Gets a value indicating whether sensitive information should be written to the underlying logger. This also has the side effect of writing a warning to the log the first time sensitive data is logged.

(Inherited from IDiagnosticsLogger<TLoggerCategory>)

Extension Methods

SensitiveDataLoggingEnabledWarning<TLoggerCategory>(IDiagnosticsLogger<TLoggerCategory>)

Logs for the SensitiveDataLoggingEnabledWarning event.

Applies to