Class DiagnosticsLogger<TLoggerCategory>
- Namespace
- Microsoft.EntityFrameworkCore.Diagnostics.Internal
- Assembly
- Microsoft.EntityFrameworkCore.dll
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public class DiagnosticsLogger<TLoggerCategory> : IDiagnosticsLogger<TLoggerCategory>, IDiagnosticsLogger where TLoggerCategory : LoggerCategory<TLoggerCategory>, new()
Type Parameters
TLoggerCategory
- Inheritance
-
DiagnosticsLogger<TLoggerCategory>
- Implements
-
IDiagnosticsLogger<TLoggerCategory>
- Inherited Members
- Extension Methods
Constructors
DiagnosticsLogger(ILoggerFactory, ILoggingOptions, DiagnosticSource, LoggingDefinitions, IDbContextLogger, IInterceptors?)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public DiagnosticsLogger(ILoggerFactory loggerFactory, ILoggingOptions loggingOptions, DiagnosticSource diagnosticSource, LoggingDefinitions loggingDefinitions, IDbContextLogger contextLogger, IInterceptors? interceptors = null)
Parameters
loggerFactory
ILoggerFactoryloggingOptions
ILoggingOptionsdiagnosticSource
DiagnosticSourceloggingDefinitions
LoggingDefinitionscontextLogger
IDbContextLoggerinterceptors
IInterceptors
Properties
DbContextLogger
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public virtual IDbContextLogger DbContextLogger { get; }
Property Value
Definitions
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public virtual LoggingDefinitions Definitions { get; }
Property Value
DiagnosticSource
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public virtual DiagnosticSource DiagnosticSource { get; }
Property Value
Interceptors
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public virtual IInterceptors? Interceptors { get; }
Property Value
Logger
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public virtual ILogger Logger { get; }
Property Value
Options
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public virtual ILoggingOptions Options { get; }
Property Value
Methods
DispatchEventData(EventDefinitionBase, EventData, bool, bool)
Dispatches the given EventData to a DiagnosticSource, if enabled, and a IDbContextLogger, if enabled.
protected void DispatchEventData(EventDefinitionBase definition, EventData eventData, bool diagnosticSourceEnabled, bool simpleLogEnabled)
Parameters
definition
EventDefinitionBaseThe definition of the event to log.
eventData
EventDataThe event data.
diagnosticSourceEnabled
boolTrue to dispatch to a DiagnosticSource; false otherwise.
simpleLogEnabled
boolTrue to dispatch to a IDbContextLogger; false otherwise.
NeedsEventData<TInterceptor>(EventDefinitionBase, out TInterceptor?, out bool, out bool)
Determines whether or not an EventData instance is needed based on whether or not there is a DiagnosticSource, an IDbContextLogger, or an IInterceptor enabled for the given event.
protected bool NeedsEventData<TInterceptor>(EventDefinitionBase definition, out TInterceptor? interceptor, out bool diagnosticSourceEnabled, out bool simpleLogEnabled) where TInterceptor : class, IInterceptor
Parameters
definition
EventDefinitionBaseThe definition of the event.
interceptor
TInterceptorThe IInterceptor to use if enabled; otherwise null.
diagnosticSourceEnabled
boolSet to true if a DiagnosticSource is enabled; false otherwise.
simpleLogEnabled
boolTrue to true if a IDbContextLogger is enabled; false otherwise.
Returns
- bool
true if either a diagnostic source, a LogTo logger, or an interceptor is enabled; false otherwise.
Type Parameters
TInterceptor
ShouldLog(EventDefinitionBase)
Checks whether or not the message should be sent to the ILogger.
protected bool ShouldLog(EventDefinitionBase definition)
Parameters
definition
EventDefinitionBaseThe definition of the event to log.
Returns
ShouldLogSensitiveData()
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public virtual bool ShouldLogSensitiveData()