DbContextOptionsBuilder.ConfigureLoggingCacheTime(TimeSpan) Method

Definition

Configures how long EF Core will cache logging configuration in certain high-performance paths. This makes EF Core skip potentially costly logging checks, but means that runtime logging changes (e.g. registering a new DiagnosticListener may not be taken into account right away).

public virtual Microsoft.EntityFrameworkCore.DbContextOptionsBuilder ConfigureLoggingCacheTime (TimeSpan timeSpan);
abstract member ConfigureLoggingCacheTime : TimeSpan -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
override this.ConfigureLoggingCacheTime : TimeSpan -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
Public Overridable Function ConfigureLoggingCacheTime (timeSpan As TimeSpan) As DbContextOptionsBuilder

Parameters

timeSpan
TimeSpan

The maximum time period over which to skip logging checks before checking again.

Returns

The same builder instance so that multiple calls can be chained.

Remarks

Defaults to one second.

See Using DbContextOptions and Logging for more information and examples.

Applies to