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
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
diagnosticsIDiagnosticsLogger<Validation>The diagnostics logger to use.
entityTypeIEntityTypeThe entity type on which the index is defined.
indexIIndexThe 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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionTransactionThe 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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
startTimeDateTimeOffsetThe 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
diagnosticsIDiagnosticsLogger<Update>The diagnostics logger to use.
contextTypeTypeThe Microsoft.EntityFrameworkCore.DbContext type being used.
exceptionExceptionThe 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
diagnosticsIDiagnosticsLogger<Update>The diagnostics logger to use.
contextTypeTypeThe Microsoft.EntityFrameworkCore.DbContext type being used.
exceptionExceptionThe 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
diagnosticsIDiagnosticsLogger<Update>The diagnostics logger to use.
entriesIEnumerable<IUpdateEntry>The entries for entities in the batch.
commandCountintThe 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
diagnosticsIDiagnosticsLogger<Update>The diagnostics logger to use.
entriesIEnumerable<IUpdateEntry>The entries for entities in the batch.
commandCountintThe number of commands.
minBatchSizeintThe 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
diagnosticsIDiagnosticsLogger<Validation>The diagnostics logger to use.
propertyIPropertyThe property.
CommandCreated(IDiagnosticsLogger<Command>, IRelationalConnection, DbCommand, DbCommandMethod, DbContext, Guid, Guid, DateTimeOffset, TimeSpan)
Logs for the CommandCreated event.
public static DbCommand CommandCreated(this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics, IRelationalConnection connection, DbCommand command, DbCommandMethod commandMethod, DbContext context, Guid commandId, Guid connectionId, DateTimeOffset startTime, TimeSpan duration)
Parameters
diagnosticsIDiagnosticsLogger<Command>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
commandDbCommandThe database command object.
commandMethodDbCommandMethodThe type of method that will be called on this command.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandIdGuidThe correlation ID associated with the given DbCommand.
connectionIdGuidThe correlation ID associated with the DbConnection being used.
startTimeDateTimeOffsetThe time that execution began.
durationTimeSpanThe duration of the command creation.
Returns
- DbCommand
An intercepted result.
CommandCreating(IDiagnosticsLogger<Command>, IRelationalConnection, DbCommandMethod, DbContext, Guid, Guid, DateTimeOffset)
Logs for the CommandCreating event.
public static InterceptionResult<DbCommand> CommandCreating(this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics, IRelationalConnection connection, DbCommandMethod commandMethod, DbContext context, Guid commandId, Guid connectionId, DateTimeOffset startTime)
Parameters
diagnosticsIDiagnosticsLogger<Command>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
commandMethodDbCommandMethodThe type of method that will be called on this command.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandIdGuidThe correlation ID associated with the given DbCommand.
connectionIdGuidThe correlation ID associated with the DbConnection being used.
startTimeDateTimeOffsetThe time that execution began.
Returns
- InterceptionResult<DbCommand>
An intercepted result.
CommandError(IDiagnosticsLogger<Command>, IRelationalConnection, DbCommand, DbContext, DbCommandMethod, Guid, Guid, Exception, DateTimeOffset, TimeSpan)
Logs for the CommandError event.
public static void CommandError(this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics, IRelationalConnection connection, DbCommand command, DbContext context, DbCommandMethod executeMethod, Guid commandId, Guid connectionId, Exception exception, DateTimeOffset startTime, TimeSpan duration)
Parameters
diagnosticsIDiagnosticsLogger<Command>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
commandDbCommandThe database command object.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
executeMethodDbCommandMethodRepresents the method that will be called to execute the command.
commandIdGuidThe correlation ID associated with the given DbCommand.
connectionIdGuidThe correlation ID associated with the DbConnection being used.
exceptionExceptionThe exception that caused this failure.
startTimeDateTimeOffsetThe time that execution began.
durationTimeSpanThe amount of time that passed until the exception was raised.
CommandErrorAsync(IDiagnosticsLogger<Command>, IRelationalConnection, DbCommand, DbContext, DbCommandMethod, Guid, Guid, Exception, DateTimeOffset, TimeSpan, CancellationToken)
Logs for the CommandError event.
public static Task CommandErrorAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics, IRelationalConnection connection, DbCommand command, DbContext context, DbCommandMethod executeMethod, Guid commandId, Guid connectionId, Exception exception, DateTimeOffset startTime, TimeSpan duration, CancellationToken cancellationToken = default)
Parameters
diagnosticsIDiagnosticsLogger<Command>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
commandDbCommandThe database command object.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
executeMethodDbCommandMethodRepresents the method that will be called to execute the command.
commandIdGuidThe correlation ID associated with the given DbCommand.
connectionIdGuidThe correlation ID associated with the DbConnection being used.
exceptionExceptionThe exception that caused this failure.
startTimeDateTimeOffsetThe time that execution began.
durationTimeSpanThe amount of time that passed until the exception was raised.
cancellationTokenCancellationTokenThe cancellation token.
Returns
CommandNonQueryExecuted(IDiagnosticsLogger<Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, int, DateTimeOffset, TimeSpan)
Logs for the CommandExecuted event.
public static int CommandNonQueryExecuted(this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics, IRelationalConnection connection, DbCommand command, DbContext context, Guid commandId, Guid connectionId, int methodResult, DateTimeOffset startTime, TimeSpan duration)
Parameters
diagnosticsIDiagnosticsLogger<Command>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
commandDbCommandThe database command object.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandIdGuidThe correlation ID associated with the given DbCommand.
connectionIdGuidThe correlation ID associated with the DbConnection being used.
methodResultintThe return value from the underlying method execution.
startTimeDateTimeOffsetThe time that execution began.
durationTimeSpanThe duration of the command execution, not including consuming results.
Returns
- int
The result of execution, which may have been modified by an interceptor.
CommandNonQueryExecutedAsync(IDiagnosticsLogger<Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, int, DateTimeOffset, TimeSpan, CancellationToken)
Logs for the CommandExecuted event.
public static ValueTask<int> CommandNonQueryExecutedAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics, IRelationalConnection connection, DbCommand command, DbContext context, Guid commandId, Guid connectionId, int methodResult, DateTimeOffset startTime, TimeSpan duration, CancellationToken cancellationToken = default)
Parameters
diagnosticsIDiagnosticsLogger<Command>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
commandDbCommandThe database command object.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandIdGuidThe correlation ID associated with the given DbCommand.
connectionIdGuidThe correlation ID associated with the DbConnection being used.
methodResultintThe return value from the underlying method execution.
startTimeDateTimeOffsetThe time that execution began.
durationTimeSpanThe duration of the command execution, not including consuming results.
cancellationTokenCancellationTokenThe cancellation token.
Returns
CommandNonQueryExecuting(IDiagnosticsLogger<Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, DateTimeOffset)
Logs for the CommandExecuting event.
public static InterceptionResult<int> CommandNonQueryExecuting(this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics, IRelationalConnection connection, DbCommand command, DbContext context, Guid commandId, Guid connectionId, DateTimeOffset startTime)
Parameters
diagnosticsIDiagnosticsLogger<Command>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
commandDbCommandThe database command object.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandIdGuidThe correlation ID associated with the given DbCommand.
connectionIdGuidThe correlation ID associated with the DbConnection being used.
startTimeDateTimeOffsetThe time that execution began.
Returns
- InterceptionResult<int>
An intercepted result.
CommandNonQueryExecutingAsync(IDiagnosticsLogger<Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, DateTimeOffset, CancellationToken)
Logs for the CommandExecuting event.
public static ValueTask<InterceptionResult<int>> CommandNonQueryExecutingAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics, IRelationalConnection connection, DbCommand command, DbContext context, Guid commandId, Guid connectionId, DateTimeOffset startTime, CancellationToken cancellationToken = default)
Parameters
diagnosticsIDiagnosticsLogger<Command>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
commandDbCommandThe database command object.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandIdGuidThe correlation ID associated with the given DbCommand.
connectionIdGuidThe correlation ID associated with the DbConnection being used.
startTimeDateTimeOffsetThe time that execution began.
cancellationTokenCancellationTokenThe cancellation token.
Returns
CommandReaderExecuted(IDiagnosticsLogger<Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, DbDataReader, DateTimeOffset, TimeSpan)
Logs for the CommandExecuted event.
public static DbDataReader CommandReaderExecuted(this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics, IRelationalConnection connection, DbCommand command, DbContext context, Guid commandId, Guid connectionId, DbDataReader methodResult, DateTimeOffset startTime, TimeSpan duration)
Parameters
diagnosticsIDiagnosticsLogger<Command>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
commandDbCommandThe database command object.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandIdGuidThe correlation ID associated with the given DbCommand.
connectionIdGuidThe correlation ID associated with the DbConnection being used.
methodResultDbDataReaderThe return value from the underlying method execution.
startTimeDateTimeOffsetThe time that execution began.
durationTimeSpanThe duration of the command execution, not including consuming results.
Returns
- DbDataReader
The result of execution, which may have been modified by an interceptor.
CommandReaderExecutedAsync(IDiagnosticsLogger<Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, DbDataReader, DateTimeOffset, TimeSpan, CancellationToken)
Logs for the CommandExecuted event.
public static ValueTask<DbDataReader> CommandReaderExecutedAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics, IRelationalConnection connection, DbCommand command, DbContext context, Guid commandId, Guid connectionId, DbDataReader methodResult, DateTimeOffset startTime, TimeSpan duration, CancellationToken cancellationToken = default)
Parameters
diagnosticsIDiagnosticsLogger<Command>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
commandDbCommandThe database command object.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandIdGuidThe correlation ID associated with the given DbCommand.
connectionIdGuidThe correlation ID associated with the DbConnection being used.
methodResultDbDataReaderThe return value from the underlying method execution.
startTimeDateTimeOffsetThe time that execution began.
durationTimeSpanThe duration of the command execution, not including consuming results.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<DbDataReader>
The result of execution, which may have been modified by an interceptor.
CommandReaderExecuting(IDiagnosticsLogger<Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, DateTimeOffset)
Logs for the CommandExecuting event.
public static InterceptionResult<DbDataReader> CommandReaderExecuting(this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics, IRelationalConnection connection, DbCommand command, DbContext context, Guid commandId, Guid connectionId, DateTimeOffset startTime)
Parameters
diagnosticsIDiagnosticsLogger<Command>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
commandDbCommandThe database command object.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandIdGuidThe correlation ID associated with the given DbCommand.
connectionIdGuidThe correlation ID associated with the DbConnection being used.
startTimeDateTimeOffsetThe time that execution began.
Returns
- InterceptionResult<DbDataReader>
An intercepted result.
CommandReaderExecutingAsync(IDiagnosticsLogger<Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, DateTimeOffset, CancellationToken)
Logs for the CommandExecuting event.
public static ValueTask<InterceptionResult<DbDataReader>> CommandReaderExecutingAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics, IRelationalConnection connection, DbCommand command, DbContext context, Guid commandId, Guid connectionId, DateTimeOffset startTime, CancellationToken cancellationToken = default)
Parameters
diagnosticsIDiagnosticsLogger<Command>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
commandDbCommandThe database command object.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandIdGuidThe correlation ID associated with the given DbCommand.
connectionIdGuidThe correlation ID associated with the DbConnection being used.
startTimeDateTimeOffsetThe time that execution began.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<InterceptionResult<DbDataReader>>
An intercepted result.
CommandScalarExecuted(IDiagnosticsLogger<Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, object, DateTimeOffset, TimeSpan)
Logs for the CommandExecuted event.
public static object CommandScalarExecuted(this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics, IRelationalConnection connection, DbCommand command, DbContext context, Guid commandId, Guid connectionId, object methodResult, DateTimeOffset startTime, TimeSpan duration)
Parameters
diagnosticsIDiagnosticsLogger<Command>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
commandDbCommandThe database command object.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandIdGuidThe correlation ID associated with the given DbCommand.
connectionIdGuidThe correlation ID associated with the DbConnection being used.
methodResultobjectThe return value from the underlying method execution.
startTimeDateTimeOffsetThe time that execution began.
durationTimeSpanThe duration of the command execution, not including consuming results.
Returns
- object
The result of execution, which may have been modified by an interceptor.
CommandScalarExecutedAsync(IDiagnosticsLogger<Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, object, DateTimeOffset, TimeSpan, CancellationToken)
Logs for the CommandExecuted event.
public static ValueTask<object> CommandScalarExecutedAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics, IRelationalConnection connection, DbCommand command, DbContext context, Guid commandId, Guid connectionId, object methodResult, DateTimeOffset startTime, TimeSpan duration, CancellationToken cancellationToken = default)
Parameters
diagnosticsIDiagnosticsLogger<Command>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
commandDbCommandThe database command object.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandIdGuidThe correlation ID associated with the given DbCommand.
connectionIdGuidThe correlation ID associated with the DbConnection being used.
methodResultobjectThe return value from the underlying method execution.
startTimeDateTimeOffsetThe time that execution began.
durationTimeSpanThe duration of the command execution, not including consuming results.
cancellationTokenCancellationTokenThe cancellation token.
Returns
CommandScalarExecuting(IDiagnosticsLogger<Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, DateTimeOffset)
Logs for the CommandExecuting event.
public static InterceptionResult<object> CommandScalarExecuting(this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics, IRelationalConnection connection, DbCommand command, DbContext context, Guid commandId, Guid connectionId, DateTimeOffset startTime)
Parameters
diagnosticsIDiagnosticsLogger<Command>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
commandDbCommandThe database command object.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandIdGuidThe correlation ID associated with the given DbCommand.
connectionIdGuidThe correlation ID associated with the DbConnection being used.
startTimeDateTimeOffsetThe time that execution began.
Returns
- InterceptionResult<object>
An intercepted result.
CommandScalarExecutingAsync(IDiagnosticsLogger<Command>, IRelationalConnection, DbCommand, DbContext, Guid, Guid, DateTimeOffset, CancellationToken)
Logs for the CommandExecuting event.
public static ValueTask<InterceptionResult<object>> CommandScalarExecutingAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics, IRelationalConnection connection, DbCommand command, DbContext context, Guid commandId, Guid connectionId, DateTimeOffset startTime, CancellationToken cancellationToken = default)
Parameters
diagnosticsIDiagnosticsLogger<Command>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
commandDbCommandThe database command object.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandIdGuidThe correlation ID associated with the given DbCommand.
connectionIdGuidThe correlation ID associated with the DbConnection being used.
startTimeDateTimeOffsetThe time that execution began.
cancellationTokenCancellationTokenThe cancellation token.
Returns
ConnectionClosed(IDiagnosticsLogger<Connection>, IRelationalConnection, DateTimeOffset, TimeSpan)
Logs for the ConnectionClosed event.
public static void ConnectionClosed(this IDiagnosticsLogger<DbLoggerCategory.Database.Connection> diagnostics, IRelationalConnection connection, DateTimeOffset startTime, TimeSpan duration)
Parameters
diagnosticsIDiagnosticsLogger<Connection>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
startTimeDateTimeOffsetThe time that the operation was started.
durationTimeSpanThe amount of time before the connection was closed.
ConnectionClosedAsync(IDiagnosticsLogger<Connection>, IRelationalConnection, DateTimeOffset, TimeSpan)
Logs for the ConnectionClosed event.
public static Task ConnectionClosedAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Connection> diagnostics, IRelationalConnection connection, DateTimeOffset startTime, TimeSpan duration)
Parameters
diagnosticsIDiagnosticsLogger<Connection>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
startTimeDateTimeOffsetThe time that the operation was started.
durationTimeSpanThe amount of time before the connection was closed.
Returns
ConnectionClosing(IDiagnosticsLogger<Connection>, IRelationalConnection, DateTimeOffset)
Logs for the ConnectionClosing event.
public static InterceptionResult ConnectionClosing(this IDiagnosticsLogger<DbLoggerCategory.Database.Connection> diagnostics, IRelationalConnection connection, DateTimeOffset startTime)
Parameters
diagnosticsIDiagnosticsLogger<Connection>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
startTimeDateTimeOffsetThe time that the operation was started.
Returns
- InterceptionResult
The result of execution, which may have been modified by an interceptor.
ConnectionClosingAsync(IDiagnosticsLogger<Connection>, IRelationalConnection, DateTimeOffset)
Logs for the ConnectionClosing event.
public static ValueTask<InterceptionResult> ConnectionClosingAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Connection> diagnostics, IRelationalConnection connection, DateTimeOffset startTime)
Parameters
diagnosticsIDiagnosticsLogger<Connection>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
startTimeDateTimeOffsetThe time that the operation was started.
Returns
ConnectionError(IDiagnosticsLogger<Connection>, IRelationalConnection, Exception, DateTimeOffset, TimeSpan, bool)
Logs for the ConnectionError event.
public static void ConnectionError(this IDiagnosticsLogger<DbLoggerCategory.Database.Connection> diagnostics, IRelationalConnection connection, Exception exception, DateTimeOffset startTime, TimeSpan duration, bool logErrorAsDebug)
Parameters
diagnosticsIDiagnosticsLogger<Connection>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
exceptionExceptionThe exception representing the error.
startTimeDateTimeOffsetThe time that the operation was started.
durationTimeSpanThe elapsed time before the operation failed.
logErrorAsDebugboolA flag indicating the exception is being handled and so it should be logged at Debug level.
ConnectionErrorAsync(IDiagnosticsLogger<Connection>, IRelationalConnection, Exception, DateTimeOffset, TimeSpan, bool, CancellationToken)
Logs for the ConnectionError event.
public static Task ConnectionErrorAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Connection> diagnostics, IRelationalConnection connection, Exception exception, DateTimeOffset startTime, TimeSpan duration, bool logErrorAsDebug, CancellationToken cancellationToken = default)
Parameters
diagnosticsIDiagnosticsLogger<Connection>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
exceptionExceptionThe exception representing the error.
startTimeDateTimeOffsetThe time that the operation was started.
durationTimeSpanThe elapsed time before the operation failed.
logErrorAsDebugboolA flag indicating the exception is being handled and so it should be logged at Debug level.
cancellationTokenCancellationTokenThe cancellation token.
Returns
ConnectionOpened(IDiagnosticsLogger<Connection>, IRelationalConnection, DateTimeOffset, TimeSpan)
Logs for the ConnectionOpened event.
public static void ConnectionOpened(this IDiagnosticsLogger<DbLoggerCategory.Database.Connection> diagnostics, IRelationalConnection connection, DateTimeOffset startTime, TimeSpan duration)
Parameters
diagnosticsIDiagnosticsLogger<Connection>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
startTimeDateTimeOffsetThe time that the operation was started.
durationTimeSpanThe amount of time before the connection was opened.
ConnectionOpenedAsync(IDiagnosticsLogger<Connection>, IRelationalConnection, DateTimeOffset, TimeSpan, CancellationToken)
Logs for the ConnectionOpened event.
public static Task ConnectionOpenedAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Connection> diagnostics, IRelationalConnection connection, DateTimeOffset startTime, TimeSpan duration, CancellationToken cancellationToken = default)
Parameters
diagnosticsIDiagnosticsLogger<Connection>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
startTimeDateTimeOffsetThe time that the operation was started.
durationTimeSpanThe amount of time before the connection was opened.
cancellationTokenCancellationTokenThe cancellation token.
Returns
ConnectionOpening(IDiagnosticsLogger<Connection>, IRelationalConnection, DateTimeOffset)
Logs for the ConnectionOpening event.
public static InterceptionResult ConnectionOpening(this IDiagnosticsLogger<DbLoggerCategory.Database.Connection> diagnostics, IRelationalConnection connection, DateTimeOffset startTime)
Parameters
diagnosticsIDiagnosticsLogger<Connection>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
startTimeDateTimeOffsetThe time that the operation was started.
Returns
- InterceptionResult
The result of execution, which may have been modified by an interceptor.
ConnectionOpeningAsync(IDiagnosticsLogger<Connection>, IRelationalConnection, DateTimeOffset, CancellationToken)
Logs for the ConnectionOpening event.
public static ValueTask<InterceptionResult> ConnectionOpeningAsync(this IDiagnosticsLogger<DbLoggerCategory.Database.Connection> diagnostics, IRelationalConnection connection, DateTimeOffset startTime, CancellationToken cancellationToken)
Parameters
diagnosticsIDiagnosticsLogger<Connection>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
startTimeDateTimeOffsetThe time that the operation was started.
cancellationTokenCancellationTokenThe cancellation token.
Returns
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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe 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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe time that the operation was started.
cancellationTokenCancellationTokenThe cancellation token.
Returns
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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe 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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe time that the operation was started.
cancellationTokenCancellationTokenThe cancellation token.
Returns
DataReaderDisposing(IDiagnosticsLogger<Command>, IRelationalConnection, DbCommand, DbDataReader, Guid, int, int, DateTimeOffset, TimeSpan)
Logs for the DataReaderDisposing event.
public static InterceptionResult DataReaderDisposing(this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics, IRelationalConnection connection, DbCommand command, DbDataReader dataReader, Guid commandId, int recordsAffected, int readCount, DateTimeOffset startTime, TimeSpan duration)
Parameters
diagnosticsIDiagnosticsLogger<Command>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
commandDbCommandThe database command object.
dataReaderDbDataReaderThe data reader.
commandIdGuidThe correlation ID associated with the given DbCommand.
recordsAffectedintThe number of records in the database that were affected.
readCountintThe number of records that were read.
startTimeDateTimeOffsetThe time that the operation was started.
durationTimeSpanThe elapsed time from when the operation was started.
Returns
- InterceptionResult
The result of execution, which may have been modified by an interceptor.
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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionTransactionThe transaction.
ForeignKeyPropertiesMappedToUnrelatedTables(IDiagnosticsLogger<Validation>, IForeignKey)
Logs the IndexPropertiesMappedToNonOverlappingTables event.
public static void ForeignKeyPropertiesMappedToUnrelatedTables(this IDiagnosticsLogger<DbLoggerCategory.Model.Validation> diagnostics, IForeignKey foreignKey)
Parameters
diagnosticsIDiagnosticsLogger<Validation>The diagnostics logger to use.
foreignKeyIForeignKeyThe 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
diagnosticsIDiagnosticsLogger<Validation>The diagnostics logger to use.
entityTypeIEntityTypeThe entity type on which the index is defined.
indexIIndexThe index on the entity type.
unmappedPropertyNamestringThe 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
diagnosticsIDiagnosticsLogger<Validation>The diagnostics logger to use.
entityTypeIEntityTypeThe entity type on which the index is defined.
indexIIndexThe index on the entity type.
property1NamestringThe first property name which is invalid.
tablesMappedToProperty1List<(string Table, string Schema)>The tables mapped to the first property.
property2NamestringThe second property name which is invalid.
tablesMappedToProperty2List<(string Table, string Schema)>The tables mapped to the second property.
MigrateUsingConnection(IDiagnosticsLogger<Migrations>, IMigrator, IRelationalConnection)
Logs for the MigrateUsingConnection event.
public static void MigrateUsingConnection(this IDiagnosticsLogger<DbLoggerCategory.Migrations> diagnostics, IMigrator migrator, IRelationalConnection connection)
Parameters
diagnosticsIDiagnosticsLogger<Migrations>The diagnostics logger to use.
migratorIMigratorThe migrator.
connectionIRelationalConnectionThe 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
diagnosticsIDiagnosticsLogger<Migrations>The diagnostics logger to use.
migratorIMigratorThe migrator.
migrationMigrationThe migration.
MigrationAttributeMissingWarning(IDiagnosticsLogger<Migrations>, TypeInfo)
Logs for the MigrationAttributeMissingWarning event.
public static void MigrationAttributeMissingWarning(this IDiagnosticsLogger<DbLoggerCategory.Migrations> diagnostics, TypeInfo migrationType)
Parameters
diagnosticsIDiagnosticsLogger<Migrations>The diagnostics logger to use.
migrationTypeTypeInfoInfo 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
diagnosticsIDiagnosticsLogger<Migrations>The diagnostics logger to use.
migratorIMigratorThe migrator.
migrationMigrationThe migration.
fromMigrationstringThe starting migration name.
toMigrationstringThe ending migration name.
idempotentboolIndicates 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
diagnosticsIDiagnosticsLogger<Migrations>The diagnostics logger to use.
migratorIMigratorThe migrator.
migrationMigrationThe migration.
fromMigrationstringThe starting migration name.
toMigrationstringThe ending migration name.
idempotentboolIndicates 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
diagnosticsIDiagnosticsLogger<Migrations>The diagnostics logger to use.
migratorIMigratorThe migrator.
migrationMigrationThe migration.
MigrationsNotApplied(IDiagnosticsLogger<Migrations>, IMigrator)
Logs for the MigrationsNotApplied event.
public static void MigrationsNotApplied(this IDiagnosticsLogger<DbLoggerCategory.Migrations> diagnostics, IMigrator migrator)
Parameters
diagnosticsIDiagnosticsLogger<Migrations>The diagnostics logger to use.
migratorIMigratorThe 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
diagnosticsIDiagnosticsLogger<Migrations>The diagnostics logger to use.
migratorIMigratorThe migrator.
migrationsAssemblyIMigrationsAssemblyThe 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
diagnosticsIDiagnosticsLogger<Validation>The diagnostics logger to use.
propertyIPropertyThe property.
MultipleCollectionIncludeWarning(IDiagnosticsLogger<Query>)
Logs for the MultipleCollectionIncludeWarning event.
public static void MultipleCollectionIncludeWarning(this IDiagnosticsLogger<DbLoggerCategory.Query> diagnostics)
Parameters
diagnosticsIDiagnosticsLogger<Query>The diagnostics logger to use.
QueryPossibleExceptionWithAggregateOperatorWarning(IDiagnosticsLogger<Query>)
Logs for the QueryPossibleExceptionWithAggregateOperatorWarning event.
[Obsolete]
public static void QueryPossibleExceptionWithAggregateOperatorWarning(this IDiagnosticsLogger<DbLoggerCategory.Query> diagnostics)
Parameters
diagnosticsIDiagnosticsLogger<Query>The diagnostics logger to use.
QueryPossibleUnintendedUseOfEqualsWarning(IDiagnosticsLogger<Query>, SqlExpression, SqlExpression)
Logs for the QueryPossibleUnintendedUseOfEqualsWarning event.
public static void QueryPossibleUnintendedUseOfEqualsWarning(this IDiagnosticsLogger<DbLoggerCategory.Query> diagnostics, SqlExpression left, SqlExpression right)
Parameters
diagnosticsIDiagnosticsLogger<Query>The diagnostics logger to use.
leftSqlExpressionThe left SQL expression of the Equals.
rightSqlExpressionThe 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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe 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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe time that the operation was started.
cancellationTokenCancellationTokenThe cancellation token.
Returns
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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe 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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe time that the operation was started.
cancellationTokenCancellationTokenThe cancellation token.
Returns
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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe 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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe time that the operation was started.
cancellationTokenCancellationTokenThe cancellation token.
Returns
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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe 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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe time that the operation was started.
cancellationTokenCancellationTokenThe cancellation token.
Returns
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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe time that the operation was started.
durationTimeSpanThe 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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe time that the operation was started.
durationTimeSpanThe elapsed time from when the operation was started.
cancellationTokenCancellationTokenThe cancellation token.
Returns
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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe 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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe time that the operation was started.
cancellationTokenCancellationTokenThe cancellation token.
Returns
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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe 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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
actionstringThe action being taken.
exceptionExceptionThe exception that represents the error.
startTimeDateTimeOffsetThe time that the operation was started.
durationTimeSpanThe 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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
actionstringThe action being taken.
exceptionExceptionThe exception that represents the error.
startTimeDateTimeOffsetThe time that the operation was started.
durationTimeSpanThe elapsed time from when the operation was started.
cancellationTokenCancellationTokenThe cancellation token.
Returns
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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe time that the operation was started.
durationTimeSpanThe 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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe time that the operation was started.
durationTimeSpanThe elapsed time from when the operation was started.
cancellationTokenCancellationTokenThe cancellation token.
Returns
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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe 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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe time that the operation was started.
cancellationTokenCancellationTokenThe cancellation token.
Returns
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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe time that the operation was started.
durationTimeSpanThe 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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe time that the operation was started.
durationTimeSpanThe amount of time before the connection was opened.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<DbTransaction>
The result of execution, which may have been modified by an interceptor.
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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
isolationLevelIsolationLevelThe transaction isolation level.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe 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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
isolationLevelIsolationLevelThe transaction isolation level.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe time that the operation was started.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<InterceptionResult<DbTransaction>>
The result of execution, which may have been modified by an interceptor.
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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe 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
diagnosticsIDiagnosticsLogger<Transaction>The diagnostics logger to use.
connectionIRelationalConnectionThe connection.
transactionDbTransactionThe transaction.
transactionIdGuidThe correlation ID associated with the DbTransaction.
startTimeDateTimeOffsetThe time that the operation was started.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<DbTransaction>
The result of execution, which may have been modified by an interceptor.