Class NpgsqlLoggingConfiguration
Configures Npgsql logging
Namespace: Npgsql
Assembly: Npgsql.dll
Syntax
public class NpgsqlLoggingConfiguration
Methods
| Improve this Doc View SourceInitializeLogging(ILoggerFactory, bool)
Globally initializes Npgsql logging to use the provided loggerFactory
.
Must be called before any Npgsql APIs are used.
This is a legacy-only, backwards compatibility API. New applications should set the logger factory on NpgsqlDataSourceBuilder and use the resulting NpgsqlDataSource instead.
Declaration
public static void InitializeLogging(ILoggerFactory loggerFactory, bool parameterLoggingEnabled = false)
Parameters
Type | Name | Description |
---|---|---|
ILoggerFactory | loggerFactory | The logging factory to use when logging from Npgsql. |
bool | parameterLoggingEnabled | Determines whether parameter contents will be logged alongside SQL statements - this may reveal sensitive information. Defaults to false. |