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
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.
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
diagnostics
IDiagnosticsLogger<Command>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
command
DbCommandThe database command object.
commandMethod
DbCommandMethodThe type of method that will be called on this command.
context
DbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandId
GuidThe correlation ID associated with the given DbCommand.
connectionId
GuidThe correlation ID associated with the DbConnection being used.
startTime
DateTimeOffsetThe time that execution began.
duration
TimeSpanThe 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
diagnostics
IDiagnosticsLogger<Command>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
commandMethod
DbCommandMethodThe type of method that will be called on this command.
context
DbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandId
GuidThe correlation ID associated with the given DbCommand.
connectionId
GuidThe correlation ID associated with the DbConnection being used.
startTime
DateTimeOffsetThe 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
diagnostics
IDiagnosticsLogger<Command>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
command
DbCommandThe database command object.
context
DbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
executeMethod
DbCommandMethodRepresents the method that will be called to execute the command.
commandId
GuidThe correlation ID associated with the given DbCommand.
connectionId
GuidThe correlation ID associated with the DbConnection being used.
exception
ExceptionThe exception that caused this failure.
startTime
DateTimeOffsetThe time that execution began.
duration
TimeSpanThe 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
diagnostics
IDiagnosticsLogger<Command>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
command
DbCommandThe database command object.
context
DbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
executeMethod
DbCommandMethodRepresents the method that will be called to execute the command.
commandId
GuidThe correlation ID associated with the given DbCommand.
connectionId
GuidThe correlation ID associated with the DbConnection being used.
exception
ExceptionThe exception that caused this failure.
startTime
DateTimeOffsetThe time that execution began.
duration
TimeSpanThe amount of time that passed until the exception was raised.
cancellationToken
CancellationTokenThe 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
diagnostics
IDiagnosticsLogger<Command>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
command
DbCommandThe database command object.
context
DbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandId
GuidThe correlation ID associated with the given DbCommand.
connectionId
GuidThe correlation ID associated with the DbConnection being used.
methodResult
intThe return value from the underlying method execution.
startTime
DateTimeOffsetThe time that execution began.
duration
TimeSpanThe 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
diagnostics
IDiagnosticsLogger<Command>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
command
DbCommandThe database command object.
context
DbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandId
GuidThe correlation ID associated with the given DbCommand.
connectionId
GuidThe correlation ID associated with the DbConnection being used.
methodResult
intThe return value from the underlying method execution.
startTime
DateTimeOffsetThe time that execution began.
duration
TimeSpanThe duration of the command execution, not including consuming results.
cancellationToken
CancellationTokenThe 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
diagnostics
IDiagnosticsLogger<Command>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
command
DbCommandThe database command object.
context
DbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandId
GuidThe correlation ID associated with the given DbCommand.
connectionId
GuidThe correlation ID associated with the DbConnection being used.
startTime
DateTimeOffsetThe 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
diagnostics
IDiagnosticsLogger<Command>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
command
DbCommandThe database command object.
context
DbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandId
GuidThe correlation ID associated with the given DbCommand.
connectionId
GuidThe correlation ID associated with the DbConnection being used.
startTime
DateTimeOffsetThe time that execution began.
cancellationToken
CancellationTokenThe 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
diagnostics
IDiagnosticsLogger<Command>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
command
DbCommandThe database command object.
context
DbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandId
GuidThe correlation ID associated with the given DbCommand.
connectionId
GuidThe correlation ID associated with the DbConnection being used.
methodResult
DbDataReaderThe return value from the underlying method execution.
startTime
DateTimeOffsetThe time that execution began.
duration
TimeSpanThe 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
diagnostics
IDiagnosticsLogger<Command>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
command
DbCommandThe database command object.
context
DbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandId
GuidThe correlation ID associated with the given DbCommand.
connectionId
GuidThe correlation ID associated with the DbConnection being used.
methodResult
DbDataReaderThe return value from the underlying method execution.
startTime
DateTimeOffsetThe time that execution began.
duration
TimeSpanThe duration of the command execution, not including consuming results.
cancellationToken
CancellationTokenThe 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
diagnostics
IDiagnosticsLogger<Command>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
command
DbCommandThe database command object.
context
DbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandId
GuidThe correlation ID associated with the given DbCommand.
connectionId
GuidThe correlation ID associated with the DbConnection being used.
startTime
DateTimeOffsetThe 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
diagnostics
IDiagnosticsLogger<Command>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
command
DbCommandThe database command object.
context
DbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandId
GuidThe correlation ID associated with the given DbCommand.
connectionId
GuidThe correlation ID associated with the DbConnection being used.
startTime
DateTimeOffsetThe time that execution began.
cancellationToken
CancellationTokenThe 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
diagnostics
IDiagnosticsLogger<Command>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
command
DbCommandThe database command object.
context
DbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandId
GuidThe correlation ID associated with the given DbCommand.
connectionId
GuidThe correlation ID associated with the DbConnection being used.
methodResult
objectThe return value from the underlying method execution.
startTime
DateTimeOffsetThe time that execution began.
duration
TimeSpanThe 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
diagnostics
IDiagnosticsLogger<Command>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
command
DbCommandThe database command object.
context
DbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandId
GuidThe correlation ID associated with the given DbCommand.
connectionId
GuidThe correlation ID associated with the DbConnection being used.
methodResult
objectThe return value from the underlying method execution.
startTime
DateTimeOffsetThe time that execution began.
duration
TimeSpanThe duration of the command execution, not including consuming results.
cancellationToken
CancellationTokenThe 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
diagnostics
IDiagnosticsLogger<Command>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
command
DbCommandThe database command object.
context
DbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandId
GuidThe correlation ID associated with the given DbCommand.
connectionId
GuidThe correlation ID associated with the DbConnection being used.
startTime
DateTimeOffsetThe 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
diagnostics
IDiagnosticsLogger<Command>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
command
DbCommandThe database command object.
context
DbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
commandId
GuidThe correlation ID associated with the given DbCommand.
connectionId
GuidThe correlation ID associated with the DbConnection being used.
startTime
DateTimeOffsetThe time that execution began.
cancellationToken
CancellationTokenThe 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
diagnostics
IDiagnosticsLogger<Connection>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
startTime
DateTimeOffsetThe time that the operation was started.
duration
TimeSpanThe 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
diagnostics
IDiagnosticsLogger<Connection>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
startTime
DateTimeOffsetThe time that the operation was started.
duration
TimeSpanThe 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
diagnostics
IDiagnosticsLogger<Connection>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
startTime
DateTimeOffsetThe 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
diagnostics
IDiagnosticsLogger<Connection>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
startTime
DateTimeOffsetThe 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
diagnostics
IDiagnosticsLogger<Connection>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
exception
ExceptionThe exception representing the error.
startTime
DateTimeOffsetThe time that the operation was started.
duration
TimeSpanThe elapsed time before the operation failed.
logErrorAsDebug
boolA 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
diagnostics
IDiagnosticsLogger<Connection>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
exception
ExceptionThe exception representing the error.
startTime
DateTimeOffsetThe time that the operation was started.
duration
TimeSpanThe elapsed time before the operation failed.
logErrorAsDebug
boolA flag indicating the exception is being handled and so it should be logged at Debug level.
cancellationToken
CancellationTokenThe 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
diagnostics
IDiagnosticsLogger<Connection>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
startTime
DateTimeOffsetThe time that the operation was started.
duration
TimeSpanThe 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
diagnostics
IDiagnosticsLogger<Connection>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
startTime
DateTimeOffsetThe time that the operation was started.
duration
TimeSpanThe amount of time before the connection was opened.
cancellationToken
CancellationTokenThe 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
diagnostics
IDiagnosticsLogger<Connection>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
startTime
DateTimeOffsetThe 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
diagnostics
IDiagnosticsLogger<Connection>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
startTime
DateTimeOffsetThe time that the operation was started.
cancellationToken
CancellationTokenThe 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
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
CancellationTokenThe 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
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
CancellationTokenThe 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
diagnostics
IDiagnosticsLogger<Command>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
command
DbCommandThe database command object.
dataReader
DbDataReaderThe data reader.
commandId
GuidThe correlation ID associated with the given DbCommand.
recordsAffected
intThe number of records in the database that were affected.
readCount
intThe number of records that were read.
startTime
DateTimeOffsetThe time that the operation was started.
duration
TimeSpanThe 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
diagnostics
IDiagnosticsLogger<Transaction>The diagnostics logger to use.
connection
IRelationalConnectionThe connection.
transaction
TransactionThe transaction.
ForeignKeyPropertiesMappedToUnrelatedTables(IDiagnosticsLogger<Validation>, IForeignKey)
Logs the IndexPropertiesMappedToNonOverlappingTables 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.
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.
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.
QueryPossibleExceptionWithAggregateOperatorWarning(IDiagnosticsLogger<Query>)
Logs for the QueryPossibleExceptionWithAggregateOperatorWarning event.
[Obsolete]
public static void QueryPossibleExceptionWithAggregateOperatorWarning(this IDiagnosticsLogger<DbLoggerCategory.Query> diagnostics)
Parameters
diagnostics
IDiagnosticsLogger<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
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
CancellationTokenThe 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
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
CancellationTokenThe 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
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
CancellationTokenThe 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
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
CancellationTokenThe 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
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
CancellationTokenThe 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
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
CancellationTokenThe 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
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
CancellationTokenThe 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
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
CancellationTokenThe 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
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
CancellationTokenThe 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
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
CancellationTokenThe 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
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
CancellationTokenThe 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
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
CancellationTokenThe cancellation token.
Returns
- ValueTask<DbTransaction>
The result of execution, which may have been modified by an interceptor.