Share via


RelationalLoggerExtensions Class

Definition

This class contains static methods used by EF Core internals and relational database providers to write information to an ILogger and a DiagnosticListener for well-known events.

This type is typically used by database providers (and other extensions). It is generally not used in application code.

public static class RelationalLoggerExtensions
type RelationalLoggerExtensions = class
Public Module RelationalLoggerExtensions
Inheritance
RelationalLoggerExtensions

Remarks

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

Methods

AcquiringMigrationLock(IDiagnosticsLogger<DbLoggerCategory.Migrations>)

Logs for the AcquiringMigrationLock event.

AllIndexPropertiesNotToMappedToAnyTable(IDiagnosticsLogger<DbLoggerCategory.Model.Validation>, IEntityType, IIndex)

Logs the AllIndexPropertiesNotToMappedToAnyTable event.

AmbientTransactionEnlisted(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, Transaction)

Logs for the AmbientTransactionEnlisted event.

AmbientTransactionWarning(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DateTimeOffset)

Logs for the AmbientTransactionWarning event.

BatchExecutorFailedToReleaseSavepoint(IDiagnosticsLogger<DbLoggerCategory.Update>, Type, Exception)

Logs for the BatchExecutorFailedToReleaseSavepoint event.

BatchExecutorFailedToRollbackToSavepoint(IDiagnosticsLogger<DbLoggerCategory.Update>, Type, Exception)

Logs for the BatchExecutorFailedToRollbackToSavepoint event.

BatchReadyForExecution(IDiagnosticsLogger<DbLoggerCategory.Update>, IEnumerable<IUpdateEntry>, Int32)

Logs for the BatchReadyForExecution event.

BatchSmallerThanMinBatchSize(IDiagnosticsLogger<DbLoggerCategory.Update>, IEnumerable<IUpdateEntry>, Int32, Int32)

Logs for the BatchSmallerThanMinBatchSize event.

BoolWithDefaultWarning(IDiagnosticsLogger<DbLoggerCategory.Model.Validation>, IProperty)

Logs for the BoolWithDefaultWarning event.

ColumnOrderIgnoredWarning(IDiagnosticsLogger<DbLoggerCategory.Migrations>, ColumnOperation)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

CommandCreated(IDiagnosticsLogger<DbLoggerCategory.Database.Command>, IRelationalConnection, DbCommand, DbCommandMethod, DbContext, Guid, Guid, DateTimeOffset, TimeSpan)

Logs for the CommandCreated event.

CommandCreating(IDiagnosticsLogger<DbLoggerCategory.Database.Command>, IRelationalConnection, DbCommandMethod, DbContext, Guid, Guid, DateTimeOffset)

Logs for the CommandCreating event.

CommandError(IDiagnosticsLogger<DbLoggerCategory.Database.Command>, IRelationalConnection, DbCommand, DbContext, DbCommandMethod, Guid, Guid, Exception, DateTimeOffset, TimeSpan)

Logs for the CommandError event.

CommandErrorAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Command>, IRelationalConnection, DbCommand, DbContext, DbCommandMethod, Guid, Guid, Exception, DateTimeOffset, TimeSpan, CancellationToken)

Logs for the CommandError event.

CommandNonQueryExecuted(IDiagnosticsLogger<DbLoggerCategory.Database.Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, Int32, DateTimeOffset, TimeSpan)

Logs for the CommandExecuted event.

CommandNonQueryExecutedAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, Int32, DateTimeOffset, TimeSpan, CancellationToken)

Logs for the CommandExecuted event.

CommandNonQueryExecuting(IDiagnosticsLogger<DbLoggerCategory.Database.Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, DateTimeOffset)

Logs for the CommandExecuting event.

CommandNonQueryExecutingAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, DateTimeOffset, CancellationToken)

Logs for the CommandExecuting event.

CommandReaderExecuted(IDiagnosticsLogger<DbLoggerCategory.Database.Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, DbDataReader, DateTimeOffset, TimeSpan)

Logs for the CommandExecuted event.

CommandReaderExecutedAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, DbDataReader, DateTimeOffset, TimeSpan, CancellationToken)

Logs for the CommandExecuted event.

CommandReaderExecuting(IDiagnosticsLogger<DbLoggerCategory.Database.Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, DateTimeOffset)

Logs for the CommandExecuting event.

CommandReaderExecutingAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, DateTimeOffset, CancellationToken)

Logs for the CommandExecuting event.

CommandScalarExecuted(IDiagnosticsLogger<DbLoggerCategory.Database.Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, Object, DateTimeOffset, TimeSpan)

Logs for the CommandExecuted event.

CommandScalarExecutedAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, Object, DateTimeOffset, TimeSpan, CancellationToken)

Logs for the CommandExecuted event.

CommandScalarExecuting(IDiagnosticsLogger<DbLoggerCategory.Database.Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, DateTimeOffset)

Logs for the CommandExecuting event.

CommandScalarExecutingAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, DateTimeOffset, CancellationToken)

Logs for the CommandExecuting event.

ConnectionClosed(IDiagnosticsLogger<DbLoggerCategory.Database.Connection>, IRelationalConnection, DateTimeOffset, TimeSpan)

Logs for the ConnectionClosed event.

ConnectionClosedAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Connection>, IRelationalConnection, DateTimeOffset, TimeSpan)

Logs for the ConnectionClosed event.

ConnectionClosing(IDiagnosticsLogger<DbLoggerCategory.Database.Connection>, IRelationalConnection, DateTimeOffset)

Logs for the ConnectionClosing event.

ConnectionClosingAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Connection>, IRelationalConnection, DateTimeOffset)

Logs for the ConnectionClosing event.

ConnectionError(IDiagnosticsLogger<DbLoggerCategory.Database.Connection>, IRelationalConnection, Exception, DateTimeOffset, TimeSpan, Boolean)

Logs for the ConnectionError event.

ConnectionErrorAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Connection>, IRelationalConnection, Exception, DateTimeOffset, TimeSpan, Boolean, CancellationToken)

Logs for the ConnectionError event.

ConnectionOpened(IDiagnosticsLogger<DbLoggerCategory.Database.Connection>, IRelationalConnection, DateTimeOffset, TimeSpan)

Logs for the ConnectionOpened event.

ConnectionOpenedAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Connection>, IRelationalConnection, DateTimeOffset, TimeSpan, CancellationToken)

Logs for the ConnectionOpened event.

ConnectionOpening(IDiagnosticsLogger<DbLoggerCategory.Database.Connection>, IRelationalConnection, DateTimeOffset)

Logs for the ConnectionOpening event.

ConnectionOpeningAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Connection>, IRelationalConnection, DateTimeOffset, CancellationToken)

Logs for the ConnectionOpening event.

CreatedTransactionSavepoint(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)

Logs for the CreatedTransactionSavepoint event.

CreatedTransactionSavepointAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, CancellationToken)

Logs for the CreatedTransactionSavepoint event.

CreatingTransactionSavepoint(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)

Logs for the CreatingTransactionSavepoint event.

CreatingTransactionSavepointAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, CancellationToken)

Logs for the CreatingTransactionSavepoint event.

DataReaderDisposing(IDiagnosticsLogger<DbLoggerCategory.Database.Command>, IRelationalConnection, DbCommand, DbDataReader, Guid, Int32, Int32, DateTimeOffset, TimeSpan)

Logs for the DataReaderDisposing event.

DuplicateColumnOrders(IDiagnosticsLogger<DbLoggerCategory.Model.Validation>, StoreObjectIdentifier, IReadOnlyList<String>)

Logs the DuplicateColumnOrders event.

ExecuteDeleteFailed(IDiagnosticsLogger<DbLoggerCategory.Query>, Type, Exception)

Logs for the ExecuteDeleteFailed event.

ExecuteUpdateFailed(IDiagnosticsLogger<DbLoggerCategory.Query>, Type, Exception)

Logs for the ExecuteUpdateFailed event.

ExplicitTransactionEnlisted(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, Transaction)

Logs for the ExplicitTransactionEnlisted event.

ForeignKeyPropertiesMappedToUnrelatedTables(IDiagnosticsLogger<DbLoggerCategory.Model.Validation>, IForeignKey)

Logs the ForeignKeyPropertiesMappedToUnrelatedTables event.

ForeignKeyTpcPrincipalWarning(IDiagnosticsLogger<DbLoggerCategory.Model.Validation>, IForeignKey)

Logs the ForeignKeyTpcPrincipalWarning event.

IndexPropertiesBothMappedAndNotMappedToTable(IDiagnosticsLogger<DbLoggerCategory.Model.Validation>, IEntityType, IIndex, String)

Logs the IndexPropertiesBothMappedAndNotMappedToTable event.

IndexPropertiesMappedToNonOverlappingTables(IDiagnosticsLogger<DbLoggerCategory.Model.Validation>, IEntityType, IIndex, String, List<ValueTuple<String,String>>, String, List<ValueTuple<String,String>>)

Logs the IndexPropertiesMappedToNonOverlappingTables event.

KeyPropertiesNotMappedToTable(IDiagnosticsLogger<DbLoggerCategory.Model.Validation>, IKey)

Logs the KeyPropertiesNotMappedToTable event.

MigrateUsingConnection(IDiagnosticsLogger<DbLoggerCategory.Migrations>, IMigrator, IRelationalConnection)

Logs for the MigrateUsingConnection event.

MigrationApplying(IDiagnosticsLogger<DbLoggerCategory.Migrations>, IMigrator, Migration)

Logs for the MigrationApplying event.

MigrationAttributeMissingWarning(IDiagnosticsLogger<DbLoggerCategory.Migrations>, TypeInfo)

Logs for the MigrationAttributeMissingWarning event.

MigrationGeneratingDownScript(IDiagnosticsLogger<DbLoggerCategory.Migrations>, IMigrator, Migration, String, String, Boolean)

Logs for the MigrationGeneratingDownScript event.

MigrationGeneratingUpScript(IDiagnosticsLogger<DbLoggerCategory.Migrations>, IMigrator, Migration, String, String, Boolean)

Logs for the MigrationGeneratingUpScript event.

MigrationReverting(IDiagnosticsLogger<DbLoggerCategory.Migrations>, IMigrator, Migration)

Logs for the MigrationReverting event.

MigrationsNotApplied(IDiagnosticsLogger<DbLoggerCategory.Migrations>, IMigrator)

Logs for the MigrationsNotApplied event.

MigrationsNotFound(IDiagnosticsLogger<DbLoggerCategory.Migrations>, IMigrator, IMigrationsAssembly)

Logs for the MigrationsNotFound event.

MigrationsUserTransactionWarning(IDiagnosticsLogger<DbLoggerCategory.Migrations>)

Logs for the MigrationsUserTransactionWarning event.

ModelValidationKeyDefaultValueWarning(IDiagnosticsLogger<DbLoggerCategory.Model.Validation>, IProperty)

Logs for the ModelValidationKeyDefaultValueWarning event.

MultipleCollectionIncludeWarning(IDiagnosticsLogger<DbLoggerCategory.Query>)

Logs for the MultipleCollectionIncludeWarning event.

NonQueryOperationFailed(IDiagnosticsLogger<DbLoggerCategory.Query>, Type, Exception)

Logs for the NonQueryOperationFailed event.

NonTransactionalMigrationOperationWarning(IDiagnosticsLogger<DbLoggerCategory.Migrations>, IMigrator, Migration, MigrationCommand)

Logs for the NonTransactionalMigrationOperationWarning event.

OptionalDependentWithAllNullPropertiesWarning(IDiagnosticsLogger<DbLoggerCategory.Update>, IUpdateEntry)

Logs the OptionalDependentWithAllNullPropertiesWarning event.

OptionalDependentWithAllNullPropertiesWarningSensitive(IDiagnosticsLogger<DbLoggerCategory.Update>, IUpdateEntry)

Logs the OptionalDependentWithAllNullPropertiesWarning event.

OptionalDependentWithoutIdentifyingPropertyWarning(IDiagnosticsLogger<DbLoggerCategory.Model.Validation>, IEntityType)

Logs the OptionalDependentWithoutIdentifyingPropertyWarning event.

PendingModelChangesWarning(IDiagnosticsLogger<DbLoggerCategory.Migrations>, Type)

Logs for the PendingModelChangesWarning event.

QueryPossibleExceptionWithAggregateOperatorWarning(IDiagnosticsLogger<DbLoggerCategory.Query>)
Obsolete.

Logs for the QueryPossibleExceptionWithAggregateOperatorWarning event.

QueryPossibleUnintendedUseOfEqualsWarning(IDiagnosticsLogger<DbLoggerCategory.Query>, MethodCallExpression)

Logs for the QueryPossibleUnintendedUseOfEqualsWarning event.

QueryPossibleUnintendedUseOfEqualsWarning(IDiagnosticsLogger<DbLoggerCategory.Query>, SqlExpression, SqlExpression)

Logs for the QueryPossibleUnintendedUseOfEqualsWarning event.

ReleasedTransactionSavepoint(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)

Logs for the ReleasedTransactionSavepoint event.

ReleasedTransactionSavepointAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, CancellationToken)

Logs for the ReleasedTransactionSavepoint event.

ReleasingTransactionSavepoint(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)

Logs for the RollingBackToTransactionSavepoint event.

ReleasingTransactionSavepointAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, CancellationToken)

Logs for the ReleasingTransactionSavepoint event.

RolledBackToTransactionSavepoint(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)

Logs for the RolledBackToTransactionSavepoint event.

RolledBackToTransactionSavepointAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, CancellationToken)

Logs for the CreatedTransactionSavepoint event.

RollingBackToTransactionSavepoint(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)

Logs for the RollingBackToTransactionSavepoint event.

RollingBackToTransactionSavepointAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, CancellationToken)

Logs for the RollingBackToTransactionSavepoint event.

StoredProcedureConcurrencyTokenNotMapped(IDiagnosticsLogger<DbLoggerCategory.Model.Validation>, IEntityType, IProperty, String)

Logs the StoredProcedureConcurrencyTokenNotMapped event.

TpcStoreGeneratedIdentityWarning(IDiagnosticsLogger<DbLoggerCategory.Model.Validation>, IProperty)

Logs the TpcStoreGeneratedIdentityWarning event.

TransactionCommitted(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, TimeSpan)

Logs for the TransactionCommitted event.

TransactionCommittedAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, TimeSpan, CancellationToken)

Logs for the TransactionCommitted event.

TransactionCommitting(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)

Logs for the TransactionCommitting event.

TransactionCommittingAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, CancellationToken)

Logs for the TransactionCommitting event.

TransactionDisposed(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)

Logs for the TransactionDisposed event.

TransactionError(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, String, Exception, DateTimeOffset, TimeSpan)

Logs for the TransactionError event.

TransactionErrorAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, String, Exception, DateTimeOffset, TimeSpan, CancellationToken)

Logs for the TransactionError event.

TransactionRolledBack(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, TimeSpan)

Logs for the TransactionRolledBack event.

TransactionRolledBackAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, TimeSpan, CancellationToken)

Logs for the TransactionRolledBack event.

TransactionRollingBack(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)

Logs for the TransactionRollingBack event.

TransactionRollingBackAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, CancellationToken)

Logs for the TransactionRollingBack event.

TransactionStarted(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, TimeSpan)

Logs for the TransactionStarted event.

TransactionStartedAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, TimeSpan, CancellationToken)

Logs for the TransactionStarted event.

TransactionStarting(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, IsolationLevel, Guid, DateTimeOffset)

Logs for the TransactionStarting event.

TransactionStartingAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, IsolationLevel, Guid, DateTimeOffset, CancellationToken)

Logs for the TransactionStarting event.

TransactionUsed(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)

Logs for the TransactionUsed event.

TransactionUsedAsync(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, CancellationToken)

Logs for the TransactionUsed event.

TriggerOnNonRootTphEntity(IDiagnosticsLogger<DbLoggerCategory.Model.Validation>, IEntityType)

Logs for the TransactionError event.

UnexpectedTrailingResultSetWhenSaving(IDiagnosticsLogger<DbLoggerCategory.Update>)

Logs for the UnexpectedTrailingResultSetWhenSaving event.

Applies to