Share via


DbContextOptionsBuilder.EnableSensitiveDataLogging Method

Definition

Overloads

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.

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 EnableSensitiveDataLogging (bool sensitiveDataLoggingEnabled = true);
abstract member EnableSensitiveDataLogging : bool -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
override this.EnableSensitiveDataLogging : bool -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
Public Overridable Function EnableSensitiveDataLogging (Optional sensitiveDataLoggingEnabled As Boolean = true) As DbContextOptionsBuilder

Parameters

sensitiveDataLoggingEnabled
Boolean

If true, then sensitive data is logged.

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

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 EnableSensitiveDataLogging ();
abstract member EnableSensitiveDataLogging : unit -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
override this.EnableSensitiveDataLogging : unit -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
Public Overridable Function EnableSensitiveDataLogging () As DbContextOptionsBuilder

Returns

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

Applies to