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

Defaults to one second.

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

DbContextOptionsBuilder<TContext>

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

Applies to