Share via


ILoggingOptions Interface

Definition

Options set at the IServiceProvider singleton level to control how messages are logged and/or thrown in exceptions.

public interface ILoggingOptions : Microsoft.EntityFrameworkCore.Infrastructure.ISingletonOptions
type ILoggingOptions = interface
    interface ISingletonOptions
Public Interface ILoggingOptions
Implements ISingletonOptions
Implements

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(Boolean).

IsSensitiveDataLoggingEnabled

Reflects the option set by EnableSensitiveDataLogging(Boolean).

IsSensitiveDataLoggingWarned

This flag is set once a warning about IsSensitiveDataLoggingEnabled has been issued to avoid logging the warning again.

WarningsConfiguration

Reflects the option set by ConfigureWarnings(Action<WarningsConfigurationBuilder>).

Methods

Initialize(IDbContextOptions)

Initializes the singleton options from the given IDbContextOptions.

(Inherited from ISingletonOptions)
ShouldWarnForStringEnumValueInJson(Type)

Returns true if a warning about string values for the given enum type has not yet been performed.

Validate(IDbContextOptions)

Validates that the options in given IDbContextOptions have not changed when compared to the options already set here, and throws if they have.

(Inherited from ISingletonOptions)

Applies to