Search Results for

    Show / Hide Table of Contents

    Class NpgsqlLoggingConfiguration

    Configures Npgsql logging

    Inheritance
    object
    NpgsqlLoggingConfiguration
    Namespace: Npgsql
    Assembly: Npgsql.dll
    Syntax
    public class NpgsqlLoggingConfiguration

    Methods

    | Improve this Doc View Source

    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.

    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.

    • Improve this Doc
    • View Source
    In This Article
    Back to top © Copyright 2023 The Npgsql Development Team