# Class NpgsqlLoggingConfiguration

Namespace
  Npgsql

Assembly
  Npgsql.dll

Configures Npgsql logging

    public class NpgsqlLoggingConfiguration

Inheritance
  object
  NpgsqlLoggingConfiguration

Inherited Members
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

## 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` ILoggerFactory

  The logging factory to use when logging from Npgsql.

`parameterLoggingEnabled` bool

  Determines whether parameter contents will be logged alongside SQL statements - this may reveal sensitive information. Defaults to false.