Share via


DbContextOptionsBuilder<TContext>.EnableSensitiveDataLogging Method

Definition

Overloads

EnableSensitiveDataLogging()

Enables application data to be included in exception messages, logging, etc. This can include the values assigned to properties of your entity instances, parameter values for commands being sent to the database, and other such data. You should only enable this flag if you have the appropriate security measures in place based on the sensitivity of this data.

EnableSensitiveDataLogging(Boolean)

Enables application data to be included in exception messages, logging, etc. This can include the values assigned to properties of your entity instances, parameter values for commands being sent to the database, and other such data. You should only enable this flag if you have the appropriate security measures in place based on the sensitivity of this data.

EnableSensitiveDataLogging()

Enables application data to be included in exception messages, logging, etc. This can include the values assigned to properties of your entity instances, parameter values for commands being sent to the database, and other such data. You should only enable this flag if you have the appropriate security measures in place based on the sensitivity of this data.

public virtual Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> EnableSensitiveDataLogging ();
override this.EnableSensitiveDataLogging : unit -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<'Context (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)>
Public Overridable Function EnableSensitiveDataLogging () As DbContextOptionsBuilder(Of TContext)

Returns

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

Applies to

EnableSensitiveDataLogging(Boolean)

Enables application data to be included in exception messages, logging, etc. This can include the values assigned to properties of your entity instances, parameter values for commands being sent to the database, and other such data. You should only enable this flag if you have the appropriate security measures in place based on the sensitivity of this data.

public virtual Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> EnableSensitiveDataLogging (bool sensitiveDataLoggingEnabled = true);
override this.EnableSensitiveDataLogging : bool -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<'Context (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)>
Public Overridable Function EnableSensitiveDataLogging (Optional sensitiveDataLoggingEnabled As Boolean = true) As DbContextOptionsBuilder(Of TContext)

Parameters

sensitiveDataLoggingEnabled
Boolean

Returns

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

Remarks

Note that if the application is setting the internal service provider through a call to UseInternalServiceProvider(IServiceProvider), then this option must configured the same way for all uses of that service provider. Consider instead not calling UseInternalServiceProvider(IServiceProvider) so that EF will manage the service providers and can create new instances as required.

See Using DbContextOptions and Logging for more information and examples.

Applies to