FallbackEventDefinition.Log Method

Definition

Overloads

Log<TLoggerCategory>(IDiagnosticsLogger<TLoggerCategory>, Action<ILogger>)
Obsolete.

Logs the event, or throws if the event has been configured to be treated as an error.

Log<TLoggerCategory>(IDiagnosticsLogger<TLoggerCategory>, WarningBehavior, Action<ILogger>)

Logs the event, or throws if the event has been configured to be treated as an error.

Log<TLoggerCategory>(IDiagnosticsLogger<TLoggerCategory>, Action<ILogger>)

Source:
FallbackEventDefinition.cs
Source:
FallbackEventDefinition.cs
Source:
FallbackEventDefinition.cs
Source:
FallbackEventDefinition.cs
Source:
FallbackEventDefinition.cs
Source:
FallbackEventDefinition.cs
Source:
FallbackEventDefinition.cs

Caution

Use the other overload

Logs the event, or throws if the event has been configured to be treated as an error.

C#
public virtual void Log<TLoggerCategory> (Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<TLoggerCategory> logger, Action<Microsoft.Extensions.Logging.ILogger> logAction) where TLoggerCategory : Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<TLoggerCategory>, new();
C#
[System.Obsolete("Use the other overload")]
public virtual void Log<TLoggerCategory> (Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<TLoggerCategory> logger, Action<Microsoft.Extensions.Logging.ILogger> logAction) where TLoggerCategory : Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<TLoggerCategory>, new();

Type Parameters

TLoggerCategory

The DbLoggerCategory.

Parameters

logger
IDiagnosticsLogger<TLoggerCategory>

The logger to which the event should be logged.

logAction
Action<ILogger>

A delegate that will log the message to an ILogger.

Attributes

Applies to

Entity Framework Core 9.0 ja muud versioonid
Toode Versioonid (aegunud)
Entity Framework Core 2.0, 5.0, 6.0, 7.0, 8.0, 9.0 (2.1, 2.2)

Log<TLoggerCategory>(IDiagnosticsLogger<TLoggerCategory>, WarningBehavior, Action<ILogger>)

Source:
FallbackEventDefinition.cs
Source:
FallbackEventDefinition.cs
Source:
FallbackEventDefinition.cs
Source:
FallbackEventDefinition.cs

Logs the event, or throws if the event has been configured to be treated as an error.

C#
public virtual void Log<TLoggerCategory> (Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<TLoggerCategory> logger, Microsoft.EntityFrameworkCore.WarningBehavior warningBehavior, Action<Microsoft.Extensions.Logging.ILogger> logAction) where TLoggerCategory : Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<TLoggerCategory>, new();

Type Parameters

TLoggerCategory

The DbLoggerCategory.

Parameters

logger
IDiagnosticsLogger<TLoggerCategory>

The logger to which the event should be logged.

warningBehavior
WarningBehavior

Whether the event should be logged, thrown as an exception or ignored.

logAction
Action<ILogger>

A delegate that will log the message to an ILogger.

Applies to

Entity Framework Core 3.1 ja muud versioonid
Toode Versioonid
Entity Framework Core 2.1, 2.2, 3.0, 3.1