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

Defaults to one second.

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

DbContextOptionsBuilder

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

Applies to