Share via


DbContextOptionsBuilder<TContext>.ConfigureLoggingCacheTime 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<TContext> ConfigureLoggingCacheTime (TimeSpan timeSpan);
override this.ConfigureLoggingCacheTime : TimeSpan -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<'Context (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)>
Public Overridable Function ConfigureLoggingCacheTime (timeSpan As TimeSpan) As DbContextOptionsBuilder(Of TContext)

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