EventDefinition<TParam1,TParam2>.Log Method

Definition

Overloads

Log<TLoggerCategory>(IDiagnosticsLogger<TLoggerCategory>, TParam1, TParam2)

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

Log<TLoggerCategory>(IDiagnosticsLogger<TLoggerCategory>, WarningBehavior, TParam1, TParam2)

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

Log<TLoggerCategory>(IDiagnosticsLogger<TLoggerCategory>, TParam1, TParam2, Exception)
Obsolete.

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

Log<TLoggerCategory>(IDiagnosticsLogger<TLoggerCategory>, WarningBehavior, TParam1, TParam2, Exception)

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

Log<TLoggerCategory>(IDiagnosticsLogger<TLoggerCategory>, TParam1, TParam2)

Source:
EventDefinition%60%60.cs
Source:
EventDefinition%60%60.cs
Source:
EventDefinition%60%60.cs
Source:
EventDefinition%60%60.cs
Source:
EventDefinition%60%60.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, TParam1 arg1, TParam2 arg2) 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.

arg1
TParam1

The first message argument.

arg2
TParam2

The second message argument.

Applies to

Entity Framework Core 9.0 ja muud versioonid
Toode Versioonid
Entity Framework Core 5.0, 6.0, 7.0, 8.0, 9.0

Log<TLoggerCategory>(IDiagnosticsLogger<TLoggerCategory>, WarningBehavior, TParam1, TParam2)

Source:
EventDefinition%60%60.cs
Source:
EventDefinition%60%60.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, TParam1 arg1, TParam2 arg2) 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.

arg1
TParam1

The first message argument.

arg2
TParam2

The second message argument.

Applies to

Entity Framework Core 3.1 ja Entity Framework Core 3.0
Toode Versioonid
Entity Framework Core 3.0, 3.1

Log<TLoggerCategory>(IDiagnosticsLogger<TLoggerCategory>, TParam1, TParam2, Exception)

Source:
EventDefinition%60%60.cs
Source:
EventDefinition%60%60.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, TParam1 arg1, TParam2 arg2, Exception exception = default) 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, TParam1 arg1, TParam2 arg2, Exception exception = default) 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.

arg1
TParam1

The first message argument.

arg2
TParam2

The second message argument.

exception
Exception

Optional exception associated with the event.

Attributes

Applies to

Entity Framework Core 2.2 ja muud versioonid
Toode Versioonid (aegunud)
Entity Framework Core 2.0 (2.1, 2.2)

Log<TLoggerCategory>(IDiagnosticsLogger<TLoggerCategory>, WarningBehavior, TParam1, TParam2, Exception)

Source:
EventDefinition%60%60.cs
Source:
EventDefinition%60%60.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, TParam1 arg1, TParam2 arg2, Exception exception = default) 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.

arg1
TParam1

The first message argument.

arg2
TParam2

The second message argument.

exception
Exception

Optional exception associated with the event.

Applies to

Entity Framework Core 2.2 ja Entity Framework Core 2.1
Toode Versioonid
Entity Framework Core 2.1, 2.2