Class NpgsqlLoggingConfiguration
- Namespace
- Npgsql
- Assembly
- Npgsql.dll
Configures Npgsql logging
public class NpgsqlLoggingConfiguration
- Inheritance
-
NpgsqlLoggingConfiguration
- Inherited Members
Methods
InitializeLogging(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.
public static void InitializeLogging(ILoggerFactory loggerFactory, bool parameterLoggingEnabled = false)
Parameters
loggerFactory
ILoggerFactoryThe logging factory to use when logging from Npgsql.
parameterLoggingEnabled
boolDetermines whether parameter contents will be logged alongside SQL statements - this may reveal sensitive information. Defaults to false.