Class RelationalLoggerExtensions
- Namespace
- Microsoft.EntityFrameworkCore.Diagnostics
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
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
- Inheritance
-
RelationalLoggerExtensions
- Inherited Members
Remarks
See Implementation of database providers and extensions for more information and examples.
Methods
AllIndexPropertiesNotToMappedToAnyTable(IDiagnosticsLogger<Validation>, IEntityType, IIndex)
Logs the AllIndexPropertiesNotToMappedToAnyTable event.
public static void AllIndexPropertiesNotToMappedToAnyTable(this IDiagnosticsLogger<DbLoggerCategory.Model.Validation> diagnostics, IEntityType entityType, IIndex index)
Parameters
diagnostics
IDiagnosticsLogger<Validation>The diagnostics logger to use.
entityType
IEntityTypeThe entity type on which the index is defined.
index
IIndexThe index on the entity type.
AmbientTransactionEnlisted(IDiagnosticsLogger<Transaction>, IRelationalConnection, Transaction)
Logs for the AmbientTransactionEnlisted event.
public static void AmbientTransactionEnlisted(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, Transaction transaction)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
TransactionThe transaction.
AmbientTransactionWarning(IDiagnosticsLogger<Transaction>, IRelationalConnection, DateTimeOffset)
Logs for the AmbientTransactionWarning event.
public static void AmbientTransactionWarning(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DateTimeOffset startTime)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
startTime
DateTimeOffsetThe time that the operation was started.
BatchExecutorFailedToReleaseSavepoint(IDiagnosticsLogger<Update>, Type, Exception)
Logs for the BatchExecutorFailedToReleaseSavepoint event.
public static void BatchExecutorFailedToReleaseSavepoint(this IDiagnosticsLogger<DbLoggerCategory.Update> diagnostics, Type contextType, Exception exception)
Parameters
diagnostics
IDiagnosticsLogger<Update>The diagnostics logger to use.
contextType
TypeThe Microsoft.EntityFrameworkCore.DbContext type being used.
exception
ExceptionThe exception that caused this failure.
BatchExecutorFailedToRollbackToSavepoint(IDiagnosticsLogger<Update>, Type, Exception)
Logs for the BatchExecutorFailedToRollbackToSavepoint event.
public static void BatchExecutorFailedToRollbackToSavepoint(this IDiagnosticsLogger<DbLoggerCategory.Update> diagnostics, Type contextType, Exception exception)
Parameters
diagnostics
IDiagnosticsLogger<Update>The diagnostics logger to use.
contextType
TypeThe Microsoft.EntityFrameworkCore.DbContext type being used.
exception
ExceptionThe exception that caused this failure.
BatchReadyForExecution(IDiagnosticsLogger<Update>, IEnumerable<IUpdateEntry>, int)
Logs for the BatchReadyForExecution event.
public static void BatchReadyForExecution(this IDiagnosticsLogger<DbLoggerCategory.Update> diagnostics, IEnumerable<IUpdateEntry> entries, int commandCount)
Parameters
diagnostics
IDiagnosticsLogger<Update>The diagnostics logger to use.
entries
IEnumerable<IUpdateEntry>The entries for entities in the batch.
commandCount
intThe number of commands.
BatchSmallerThanMinBatchSize(IDiagnosticsLogger<Update>, IEnumerable<IUpdateEntry>, int, int)
Logs for the BatchSmallerThanMinBatchSize event.
public static void BatchSmallerThanMinBatchSize(this IDiagnosticsLogger<DbLoggerCategory.Update> diagnostics, IEnumerable<IUpdateEntry> entries, int commandCount, int minBatchSize)
Parameters
diagnostics
IDiagnosticsLogger<Update>The diagnostics logger to use.
entries
IEnumerable<IUpdateEntry>The entries for entities in the batch.
commandCount
intThe number of commands.
minBatchSize
intThe minimum batch size.
BoolWithDefaultWarning(IDiagnosticsLogger<Validation>, IProperty)
Logs for the BoolWithDefaultWarning event.
public static void BoolWithDefaultWarning(this IDiagnosticsLogger<DbLoggerCategory.Model.Validation> diagnostics, IProperty property)
Parameters
diagnostics
IDiagnosticsLogger<Validation>The diagnostics logger to use.
property
IPropertyThe property.
ColumnOrderIgnoredWarning(IDiagnosticsLogger<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.
public static void ColumnOrderIgnoredWarning(this IDiagnosticsLogger<DbLoggerCategory.Migrations> diagnostics, ColumnOperation operation)
Parameters
diagnostics
IDiagnosticsLogger<Migrations>operation
ColumnOperation
CreatedTransactionSavepoint(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)
Logs for the CreatedTransactionSavepoint event.
public static void CreatedTransactionSavepoint(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
CreatedTransactionSavepointAsync(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, CancellationToken)
Logs for the CreatedTransactionSavepoint event.
public static Task CreatedTransactionSavepointAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime, CancellationToken cancellationToken = default)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.
CreatingTransactionSavepoint(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)
Logs for the CreatingTransactionSavepoint event.
public static InterceptionResult CreatingTransactionSavepoint(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
Returns
- InterceptionResult
The result of execution, which may have been modified by an interceptor.
CreatingTransactionSavepointAsync(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, CancellationToken)
Logs for the CreatingTransactionSavepoint event.
public static ValueTask<InterceptionResult> CreatingTransactionSavepointAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime, CancellationToken cancellationToken = default)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.
DuplicateColumnOrders(IDiagnosticsLogger<Validation>, StoreObjectIdentifier, IReadOnlyList<string>)
Logs the DuplicateColumnOrders event.
public static void DuplicateColumnOrders(this IDiagnosticsLogger<DbLoggerCategory.Model.Validation> diagnostics, StoreObjectIdentifier storeObject, IReadOnlyList<string> columns)
Parameters
diagnostics
IDiagnosticsLogger<Validation>The diagnostics logger to use.
storeObject
StoreObjectIdentifierThe table.
columns
IReadOnlyList<string>The columns.
ExecuteDeleteFailed(IDiagnosticsLogger<Query>, Type, Exception)
Logs for the ExecuteDeleteFailed event.
public static void ExecuteDeleteFailed(this IDiagnosticsLogger<DbLoggerCategory.Query> diagnostics, Type contextType, Exception exception)
Parameters
diagnostics
IDiagnosticsLogger<Query>The diagnostics logger to use.
contextType
TypeThe Microsoft.EntityFrameworkCore.DbContext type being used.
exception
ExceptionThe exception that caused this failure.
ExecuteUpdateFailed(IDiagnosticsLogger<Query>, Type, Exception)
Logs for the ExecuteUpdateFailed event.
public static void ExecuteUpdateFailed(this IDiagnosticsLogger<DbLoggerCategory.Query> diagnostics, Type contextType, Exception exception)
Parameters
diagnostics
IDiagnosticsLogger<Query>The diagnostics logger to use.
contextType
TypeThe Microsoft.EntityFrameworkCore.DbContext type being used.
exception
ExceptionThe exception that caused this failure.
ExplicitTransactionEnlisted(IDiagnosticsLogger<Transaction>, IRelationalConnection, Transaction)
Logs for the ExplicitTransactionEnlisted event.
public static void ExplicitTransactionEnlisted(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, Transaction transaction)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
TransactionThe transaction.
ForeignKeyPropertiesMappedToUnrelatedTables(IDiagnosticsLogger<Validation>, IForeignKey)
Logs the ForeignKeyPropertiesMappedToUnrelatedTables event.
public static void ForeignKeyPropertiesMappedToUnrelatedTables(this IDiagnosticsLogger<DbLoggerCategory.Model.Validation> diagnostics, IForeignKey foreignKey)
Parameters
diagnostics
IDiagnosticsLogger<Validation>The diagnostics logger to use.
foreignKey
IForeignKeyThe foreign key.
ForeignKeyTpcPrincipalWarning(IDiagnosticsLogger<Validation>, IForeignKey)
Logs the ForeignKeyTpcPrincipalWarning event.
public static void ForeignKeyTpcPrincipalWarning(this IDiagnosticsLogger<DbLoggerCategory.Model.Validation> diagnostics, IForeignKey foreignKey)
Parameters
diagnostics
IDiagnosticsLogger<Validation>The diagnostics logger to use.
foreignKey
IForeignKeyThe foreign key.
IndexPropertiesBothMappedAndNotMappedToTable(IDiagnosticsLogger<Validation>, IEntityType, IIndex, string)
Logs the IndexPropertiesBothMappedAndNotMappedToTable event.
public static void IndexPropertiesBothMappedAndNotMappedToTable(this IDiagnosticsLogger<DbLoggerCategory.Model.Validation> diagnostics, IEntityType entityType, IIndex index, string unmappedPropertyName)
Parameters
diagnostics
IDiagnosticsLogger<Validation>The diagnostics logger to use.
entityType
IEntityTypeThe entity type on which the index is defined.
index
IIndexThe index on the entity type.
unmappedPropertyName
stringThe name of the property which is not mapped.
IndexPropertiesMappedToNonOverlappingTables(IDiagnosticsLogger<Validation>, IEntityType, IIndex, string, List<(string Table, string? Schema)>, string, List<(string Table, string? Schema)>)
Logs the IndexPropertiesMappedToNonOverlappingTables event.
public static void IndexPropertiesMappedToNonOverlappingTables(this IDiagnosticsLogger<DbLoggerCategory.Model.Validation> diagnostics, IEntityType entityType, IIndex index, string property1Name, List<(string Table, string? Schema)> tablesMappedToProperty1, string property2Name, List<(string Table, string? Schema)> tablesMappedToProperty2)
Parameters
diagnostics
IDiagnosticsLogger<Validation>The diagnostics logger to use.
entityType
IEntityTypeThe entity type on which the index is defined.
index
IIndexThe index on the entity type.
property1Name
stringThe first property name which is invalid.
tablesMappedToProperty1
List<(string Table, string Schema)>The tables mapped to the first property.
property2Name
stringThe second property name which is invalid.
tablesMappedToProperty2
List<(string Table, string Schema)>The tables mapped to the second property.
KeyPropertiesNotMappedToTable(IDiagnosticsLogger<Validation>, IKey)
Logs the KeyPropertiesNotMappedToTable event.
public static void KeyPropertiesNotMappedToTable(this IDiagnosticsLogger<DbLoggerCategory.Model.Validation> diagnostics, IKey key)
Parameters
diagnostics
IDiagnosticsLogger<Validation>The diagnostics logger to use.
key
IKeyThe foreign key.
MigrateUsingConnection(IDiagnosticsLogger<Migrations>, IMigrator, IRelationalConnection)
Logs for the MigrateUsingConnection event.
public static void MigrateUsingConnection(this IDiagnosticsLogger<DbLoggerCategory.Migrations> diagnostics, IMigrator migrator, IRelationalConnection connection)
Parameters
diagnostics
IDiagnosticsLogger<Migrations>The diagnostics logger to use.
migrator
IMigratorThe migrator.
connection
IRelationalConnectionThe connection.
MigrationApplying(IDiagnosticsLogger<Migrations>, IMigrator, Migration)
Logs for the MigrationApplying event.
public static void MigrationApplying(this IDiagnosticsLogger<DbLoggerCategory.Migrations> diagnostics, IMigrator migrator, Migration migration)
Parameters
diagnostics
IDiagnosticsLogger<Migrations>The diagnostics logger to use.
migrator
IMigratorThe migrator.
migration
MigrationThe migration.
MigrationAttributeMissingWarning(IDiagnosticsLogger<Migrations>, TypeInfo)
Logs for the MigrationAttributeMissingWarning event.
public static void MigrationAttributeMissingWarning(this IDiagnosticsLogger<DbLoggerCategory.Migrations> diagnostics, TypeInfo migrationType)
Parameters
diagnostics
IDiagnosticsLogger<Migrations>The diagnostics logger to use.
migrationType
TypeInfoInfo for the migration type.
MigrationGeneratingDownScript(IDiagnosticsLogger<Migrations>, IMigrator, Migration, string?, string?, bool)
Logs for the MigrationGeneratingDownScript event.
public static void MigrationGeneratingDownScript(this IDiagnosticsLogger<DbLoggerCategory.Migrations> diagnostics, IMigrator migrator, Migration migration, string? fromMigration, string? toMigration, bool idempotent)
Parameters
diagnostics
IDiagnosticsLogger<Migrations>The diagnostics logger to use.
migrator
IMigratorThe migrator.
migration
MigrationThe migration.
fromMigration
stringThe starting migration name.
toMigration
stringThe ending migration name.
idempotent
boolIndicates whether or not an idempotent script is being generated.
MigrationGeneratingUpScript(IDiagnosticsLogger<Migrations>, IMigrator, Migration, string?, string?, bool)
Logs for the MigrationGeneratingUpScript event.
public static void MigrationGeneratingUpScript(this IDiagnosticsLogger<DbLoggerCategory.Migrations> diagnostics, IMigrator migrator, Migration migration, string? fromMigration, string? toMigration, bool idempotent)
Parameters
diagnostics
IDiagnosticsLogger<Migrations>The diagnostics logger to use.
migrator
IMigratorThe migrator.
migration
MigrationThe migration.
fromMigration
stringThe starting migration name.
toMigration
stringThe ending migration name.
idempotent
boolIndicates whether or not an idempotent script is being generated.
MigrationReverting(IDiagnosticsLogger<Migrations>, IMigrator, Migration)
Logs for the MigrationReverting event.
public static void MigrationReverting(this IDiagnosticsLogger<DbLoggerCategory.Migrations> diagnostics, IMigrator migrator, Migration migration)
Parameters
diagnostics
IDiagnosticsLogger<Migrations>The diagnostics logger to use.
migrator
IMigratorThe migrator.
migration
MigrationThe migration.
MigrationsNotApplied(IDiagnosticsLogger<Migrations>, IMigrator)
Logs for the MigrationsNotApplied event.
public static void MigrationsNotApplied(this IDiagnosticsLogger<DbLoggerCategory.Migrations> diagnostics, IMigrator migrator)
Parameters
diagnostics
IDiagnosticsLogger<Migrations>The diagnostics logger to use.
migrator
IMigratorThe migrator.
MigrationsNotFound(IDiagnosticsLogger<Migrations>, IMigrator, IMigrationsAssembly)
Logs for the MigrationsNotFound event.
public static void MigrationsNotFound(this IDiagnosticsLogger<DbLoggerCategory.Migrations> diagnostics, IMigrator migrator, IMigrationsAssembly migrationsAssembly)
Parameters
diagnostics
IDiagnosticsLogger<Migrations>The diagnostics logger to use.
migrator
IMigratorThe migrator.
migrationsAssembly
IMigrationsAssemblyThe assembly in which migrations are stored.
ModelValidationKeyDefaultValueWarning(IDiagnosticsLogger<Validation>, IProperty)
Logs for the ModelValidationKeyDefaultValueWarning event.
public static void ModelValidationKeyDefaultValueWarning(this IDiagnosticsLogger<DbLoggerCategory.Model.Validation> diagnostics, IProperty property)
Parameters
diagnostics
IDiagnosticsLogger<Validation>The diagnostics logger to use.
property
IPropertyThe property.
MultipleCollectionIncludeWarning(IDiagnosticsLogger<Query>)
Logs for the MultipleCollectionIncludeWarning event.
public static void MultipleCollectionIncludeWarning(this IDiagnosticsLogger<DbLoggerCategory.Query> diagnostics)
Parameters
diagnostics
IDiagnosticsLogger<Query>The diagnostics logger to use.
NonQueryOperationFailed(IDiagnosticsLogger<Query>, Type, Exception)
Logs for the NonQueryOperationFailed event.
public static void NonQueryOperationFailed(this IDiagnosticsLogger<DbLoggerCategory.Query> diagnostics, Type contextType, Exception exception)
Parameters
diagnostics
IDiagnosticsLogger<Query>The diagnostics logger to use.
contextType
TypeThe Microsoft.EntityFrameworkCore.DbContext type being used.
exception
ExceptionThe exception that caused this failure.
OptionalDependentWithAllNullPropertiesWarning(IDiagnosticsLogger<Update>, IUpdateEntry)
Logs the OptionalDependentWithAllNullPropertiesWarning event.
public static void OptionalDependentWithAllNullPropertiesWarning(this IDiagnosticsLogger<DbLoggerCategory.Update> diagnostics, IUpdateEntry entry)
Parameters
diagnostics
IDiagnosticsLogger<Update>The diagnostics logger to use.
entry
IUpdateEntryThe entry.
OptionalDependentWithAllNullPropertiesWarningSensitive(IDiagnosticsLogger<Update>, IUpdateEntry)
Logs the OptionalDependentWithAllNullPropertiesWarning event.
public static void OptionalDependentWithAllNullPropertiesWarningSensitive(this IDiagnosticsLogger<DbLoggerCategory.Update> diagnostics, IUpdateEntry entry)
Parameters
diagnostics
IDiagnosticsLogger<Update>The diagnostics logger to use.
entry
IUpdateEntryThe entry.
OptionalDependentWithoutIdentifyingPropertyWarning(IDiagnosticsLogger<Validation>, IEntityType)
Logs the OptionalDependentWithoutIdentifyingPropertyWarning event.
public static void OptionalDependentWithoutIdentifyingPropertyWarning(this IDiagnosticsLogger<DbLoggerCategory.Model.Validation> diagnostics, IEntityType entityType)
Parameters
diagnostics
IDiagnosticsLogger<Validation>The diagnostics logger to use.
entityType
IEntityTypeThe entity type.
QueryPossibleUnintendedUseOfEqualsWarning(IDiagnosticsLogger<Query>, SqlExpression, SqlExpression)
Logs for the QueryPossibleUnintendedUseOfEqualsWarning event.
public static void QueryPossibleUnintendedUseOfEqualsWarning(this IDiagnosticsLogger<DbLoggerCategory.Query> diagnostics, SqlExpression left, SqlExpression right)
Parameters
diagnostics
IDiagnosticsLogger<Query>The diagnostics logger to use.
left
SqlExpressionThe left SQL expression of the Equals.
right
SqlExpressionThe right SQL expression of the Equals.
ReleasedTransactionSavepoint(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)
Logs for the ReleasedTransactionSavepoint event.
public static void ReleasedTransactionSavepoint(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
ReleasedTransactionSavepointAsync(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, CancellationToken)
Logs for the ReleasedTransactionSavepoint event.
public static Task ReleasedTransactionSavepointAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime, CancellationToken cancellationToken = default)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.
ReleasingTransactionSavepoint(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)
Logs for the RollingBackToTransactionSavepoint event.
public static InterceptionResult ReleasingTransactionSavepoint(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
Returns
- InterceptionResult
The result of execution, which may have been modified by an interceptor.
ReleasingTransactionSavepointAsync(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, CancellationToken)
Logs for the ReleasingTransactionSavepoint event.
public static ValueTask<InterceptionResult> ReleasingTransactionSavepointAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime, CancellationToken cancellationToken = default)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.
RolledBackToTransactionSavepoint(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)
Logs for the RolledBackToTransactionSavepoint event.
public static void RolledBackToTransactionSavepoint(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
RolledBackToTransactionSavepointAsync(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, CancellationToken)
Logs for the CreatedTransactionSavepoint event.
public static Task RolledBackToTransactionSavepointAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime, CancellationToken cancellationToken = default)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.
RollingBackToTransactionSavepoint(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)
Logs for the RollingBackToTransactionSavepoint event.
public static InterceptionResult RollingBackToTransactionSavepoint(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
Returns
- InterceptionResult
The result of execution, which may have been modified by an interceptor.
RollingBackToTransactionSavepointAsync(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, CancellationToken)
Logs for the RollingBackToTransactionSavepoint event.
public static ValueTask<InterceptionResult> RollingBackToTransactionSavepointAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime, CancellationToken cancellationToken = default)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.
StoredProcedureConcurrencyTokenNotMapped(IDiagnosticsLogger<Validation>, IEntityType, IProperty, string)
Logs the StoredProcedureConcurrencyTokenNotMapped event.
public static void StoredProcedureConcurrencyTokenNotMapped(this IDiagnosticsLogger<DbLoggerCategory.Model.Validation> diagnostics, IEntityType entityType, IProperty concurrencyProperty, string storedProcedureName)
Parameters
diagnostics
IDiagnosticsLogger<Validation>The diagnostics logger to use.
entityType
IEntityTypeThe entity type that the stored procedure is mapped to.
concurrencyProperty
IPropertyThe property which represents the concurrency token.
storedProcedureName
stringThe stored procedure name.
TpcStoreGeneratedIdentityWarning(IDiagnosticsLogger<Validation>, IProperty)
Logs the TpcStoreGeneratedIdentityWarning event.
public static void TpcStoreGeneratedIdentityWarning(this IDiagnosticsLogger<DbLoggerCategory.Model.Validation> diagnostics, IProperty property)
Parameters
diagnostics
IDiagnosticsLogger<Validation>The diagnostics logger to use.
property
IPropertyThe entity type on which the index is defined.
TransactionCommitted(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, TimeSpan)
Logs for the TransactionCommitted event.
public static void TransactionCommitted(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime, TimeSpan duration)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
duration
TimeSpanThe elapsed time from when the operation was started.
TransactionCommittedAsync(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, TimeSpan, CancellationToken)
Logs for the TransactionCommitted event.
public static Task TransactionCommittedAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime, TimeSpan duration, CancellationToken cancellationToken = default)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
duration
TimeSpanThe elapsed time from when the operation was started.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.
TransactionCommitting(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)
Logs for the TransactionCommitting event.
public static InterceptionResult TransactionCommitting(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
Returns
- InterceptionResult
The result of execution, which may have been modified by an interceptor.
TransactionCommittingAsync(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, CancellationToken)
Logs for the TransactionCommitting event.
public static ValueTask<InterceptionResult> TransactionCommittingAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime, CancellationToken cancellationToken = default)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.
TransactionDisposed(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)
Logs for the TransactionDisposed event.
public static void TransactionDisposed(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
TransactionError(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, string, Exception, DateTimeOffset, TimeSpan)
Logs for the TransactionError event.
public static void TransactionError(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, string action, Exception exception, DateTimeOffset startTime, TimeSpan duration)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
action
stringThe action being taken.
exception
ExceptionThe exception that represents the error.
startTime
DateTimeOffsetThe time that the operation was started.
duration
TimeSpanThe elapsed time from when the operation was started.
TransactionErrorAsync(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, string, Exception, DateTimeOffset, TimeSpan, CancellationToken)
Logs for the TransactionError event.
public static Task TransactionErrorAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, string action, Exception exception, DateTimeOffset startTime, TimeSpan duration, CancellationToken cancellationToken = default)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
action
stringThe action being taken.
exception
ExceptionThe exception that represents the error.
startTime
DateTimeOffsetThe time that the operation was started.
duration
TimeSpanThe elapsed time from when the operation was started.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.
TransactionRolledBack(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, TimeSpan)
Logs for the TransactionRolledBack event.
public static void TransactionRolledBack(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime, TimeSpan duration)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
duration
TimeSpanThe elapsed time from when the operation was started.
TransactionRolledBackAsync(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, TimeSpan, CancellationToken)
Logs for the TransactionRolledBack event.
public static Task TransactionRolledBackAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime, TimeSpan duration, CancellationToken cancellationToken = default)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
duration
TimeSpanThe elapsed time from when the operation was started.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.
TransactionRollingBack(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)
Logs for the TransactionRollingBack event.
public static InterceptionResult TransactionRollingBack(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
Returns
- InterceptionResult
The result of execution, which may have been modified by an interceptor.
TransactionRollingBackAsync(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, CancellationToken)
Logs for the TransactionRollingBack event.
public static ValueTask<InterceptionResult> TransactionRollingBackAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime, CancellationToken cancellationToken = default)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.
TransactionStarted(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, TimeSpan)
Logs for the TransactionStarted event.
public static DbTransaction TransactionStarted(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime, TimeSpan duration)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
duration
TimeSpanThe amount of time before the connection was opened.
Returns
- DbTransaction
The result of execution, which may have been modified by an interceptor.
TransactionStartedAsync(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, TimeSpan, CancellationToken)
Logs for the TransactionStarted event.
public static ValueTask<DbTransaction> TransactionStartedAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime, TimeSpan duration, CancellationToken cancellationToken = default)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
duration
TimeSpanThe amount of time before the connection was opened.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
- ValueTask<DbTransaction>
The result of execution, which may have been modified by an interceptor.
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.
TransactionStarting(IDiagnosticsLogger<Transaction>, IRelationalConnection, IsolationLevel, Guid, DateTimeOffset)
Logs for the TransactionStarting event.
public static InterceptionResult<DbTransaction> TransactionStarting(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, IsolationLevel isolationLevel, Guid transactionId, DateTimeOffset startTime)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
isolationLevel
IsolationLevelThe transaction isolation level.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
Returns
- InterceptionResult<DbTransaction>
The result of execution, which may have been modified by an interceptor.
TransactionStartingAsync(IDiagnosticsLogger<Transaction>, IRelationalConnection, IsolationLevel, Guid, DateTimeOffset, CancellationToken)
Logs for the TransactionStarting event.
public static ValueTask<InterceptionResult<DbTransaction>> TransactionStartingAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, IsolationLevel isolationLevel, Guid transactionId, DateTimeOffset startTime, CancellationToken cancellationToken = default)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
isolationLevel
IsolationLevelThe transaction isolation level.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
- ValueTask<InterceptionResult<DbTransaction>>
The result of execution, which may have been modified by an interceptor.
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.
TransactionUsed(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset)
Logs for the TransactionUsed event.
public static DbTransaction TransactionUsed(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
Returns
- DbTransaction
The result of execution, which may have been modified by an interceptor.
TransactionUsedAsync(IDiagnosticsLogger<Transaction>, IRelationalConnection, DbTransaction, Guid, DateTimeOffset, CancellationToken)
Logs for the TransactionUsed event.
public static ValueTask<DbTransaction> TransactionUsedAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> diagnostics, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, DateTimeOffset startTime, CancellationToken cancellationToken = default)
Parameters
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
DbTransactionThe transaction.
transactionId
GuidThe correlation ID associated with the DbTransaction.
startTime
DateTimeOffsetThe time that the operation was started.
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
- ValueTask<DbTransaction>
The result of execution, which may have been modified by an interceptor.
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.
UnexpectedTrailingResultSetWhenSaving(IDiagnosticsLogger<Update>)
Logs for the UnexpectedTrailingResultSetWhenSaving event.
public static void UnexpectedTrailingResultSetWhenSaving(this IDiagnosticsLogger<DbLoggerCategory.Update> diagnostics)
Parameters
diagnostics
IDiagnosticsLogger<Update>The diagnostics logger to use.