FallbackEventDefinition.Log Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. |
- 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.
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();
[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();
abstract member Log : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<'LoggerCategory (requires 'LoggerCategory :> Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<'LoggerCategory> and 'LoggerCategory : (new : unit -> 'LoggerCategory))> * Action<Microsoft.Extensions.Logging.ILogger> -> unit (requires 'LoggerCategory :> Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<'LoggerCategory> and 'LoggerCategory : (new : unit -> 'LoggerCategory))
override this.Log : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<'LoggerCategory (requires 'LoggerCategory :> Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<'LoggerCategory> and 'LoggerCategory : (new : unit -> 'LoggerCategory))> * Action<Microsoft.Extensions.Logging.ILogger> -> unit (requires 'LoggerCategory :> Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<'LoggerCategory> and 'LoggerCategory : (new : unit -> 'LoggerCategory))
[<System.Obsolete("Use the other overload")>]
abstract member Log : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<'LoggerCategory (requires 'LoggerCategory :> Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<'LoggerCategory> and 'LoggerCategory : (new : unit -> 'LoggerCategory))> * Action<Microsoft.Extensions.Logging.ILogger> -> unit (requires 'LoggerCategory :> Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<'LoggerCategory> and 'LoggerCategory : (new : unit -> 'LoggerCategory))
override this.Log : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<'LoggerCategory (requires 'LoggerCategory :> Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<'LoggerCategory> and 'LoggerCategory : (new : unit -> 'LoggerCategory))> * Action<Microsoft.Extensions.Logging.ILogger> -> unit (requires 'LoggerCategory :> Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<'LoggerCategory> and 'LoggerCategory : (new : unit -> 'LoggerCategory))
Public Overridable Sub Log(Of TLoggerCategory As {LoggerCategory(Of TLoggerCategory)New}) (logger As IDiagnosticsLogger(Of TLoggerCategory), logAction As Action(Of ILogger))
Type Parameters
- TLoggerCategory
The DbLoggerCategory.
Parameters
The logger to which the event should be logged.
- 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) |
- 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.
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();
abstract member Log : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<'LoggerCategory (requires 'LoggerCategory :> Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<'LoggerCategory> and 'LoggerCategory : (new : unit -> 'LoggerCategory))> * Microsoft.EntityFrameworkCore.WarningBehavior * Action<Microsoft.Extensions.Logging.ILogger> -> unit (requires 'LoggerCategory :> Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<'LoggerCategory> and 'LoggerCategory : (new : unit -> 'LoggerCategory))
override this.Log : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<'LoggerCategory (requires 'LoggerCategory :> Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<'LoggerCategory> and 'LoggerCategory : (new : unit -> 'LoggerCategory))> * Microsoft.EntityFrameworkCore.WarningBehavior * Action<Microsoft.Extensions.Logging.ILogger> -> unit (requires 'LoggerCategory :> Microsoft.EntityFrameworkCore.Diagnostics.LoggerCategory<'LoggerCategory> and 'LoggerCategory : (new : unit -> 'LoggerCategory))
Public Overridable Sub Log(Of TLoggerCategory As {LoggerCategory(Of TLoggerCategory)New}) (logger As IDiagnosticsLogger(Of TLoggerCategory), warningBehavior As WarningBehavior, logAction As Action(Of ILogger))
Type Parameters
- TLoggerCategory
The DbLoggerCategory.
Parameters
The logger to which the event should be logged.
- warningBehavior
- WarningBehavior
Whether the event should be logged, thrown as an exception or ignored.
Applies to
Entity Framework Core 3.1 ja muud versioonid
Toode | Versioonid |
---|---|
Entity Framework Core | 2.1, 2.2, 3.0, 3.1 |
Toote „Entity Framework“ tagasiside
Entity Framework on avatud lähtekoodiga projekt. Tagasiside andmiseks valige link: