Interface ILoggingOptions
- Namespace
- Microsoft.EntityFrameworkCore.Diagnostics
- Assembly
- Microsoft.EntityFrameworkCore.dll
Options set at the IServiceProvider singleton level to control how messages are logged and/or thrown in exceptions.
public interface ILoggingOptions : ISingletonOptions
- Inherited Members
Remarks
The service lifetime is Singleton. This means a single instance is used by many DbContext instances. The implementation must be thread-safe. This service cannot depend on services registered as Scoped.
See Logging, events, and diagnostics for more information and examples.
Properties
DetailedErrorsEnabled
Reflects the option set by EnableDetailedErrors(bool).
bool DetailedErrorsEnabled { get; }
Property Value
IsSensitiveDataLoggingEnabled
Reflects the option set by EnableSensitiveDataLogging(bool).
bool IsSensitiveDataLoggingEnabled { get; }
Property Value
IsSensitiveDataLoggingWarned
This flag is set once a warning about IsSensitiveDataLoggingEnabled has been issued to avoid logging the warning again.
bool IsSensitiveDataLoggingWarned { get; set; }
Property Value
WarningsConfiguration
Reflects the option set by ConfigureWarnings(Action<WarningsConfigurationBuilder>).
WarningsConfiguration WarningsConfiguration { get; }
Property Value
Methods
ShouldWarnForStringEnumValueInJson(Type)
Returns true if a warning about string values for the given enum type has not yet been performed.
bool ShouldWarnForStringEnumValueInJson(Type enumType)
Parameters
enumType
TypeThe type to check.
Returns
- bool
Whether or not a warning has been issued.