Documentation Home
MySQL 8.4 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 40.2Mb
PDF (A4) - 40.3Mb
Man Pages (TGZ) - 261.9Kb
Man Pages (Zip) - 367.5Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb


29.12.21.1 The setup_loggers Table

The setup_loggers table lists the registered loggers and their logging level:

mysql>  select * from performance_schema.setup_loggers;
+------------------------+-------+-------------------------+
| NAME                   | LEVEL | DESCRIPTION             |
+------------------------+-------+-------------------------+
| logger/sql/error_log   | info  | MySQL error logger      |
| logger/sql/slow_log    | info  | MySQL slow query logger |
| logger/sql/general_log | info  | MySQL general logger    |
+------------------------+-------+-------------------------+
  • NAME: The name of the logger.

    This can be one of the following:

    • logger/sql/error_log

    • logger/sql/general_log

      The General log does not have a log level. All logs are instrumented using INFO. It is also independent of the existing configuration. For example, if log_output or general_log is disabled, general OpenTelemetry logging continues.

    • logger/sql/slow_log

      The Slow Query log does not have a log level. All logs are instrumented using WARN. It is also independent of the existing configuration. For example, if log_output or slow_query_log is disabled, Slow Query OpenTelemetry logging continues. Similarly, on replicas, if log_slow_replica_statements is disabled, Slow query OpenTelemetry logging continues on the replica.

  • LEVEL: The log level. This can be set to one of the following values:

    • none

    • error

    • warn

    • info

    • debug

  • DESCRIPTION: A text description of the logger.

Server Configuration Command Line

This section describes the logger-related command line configuration options.

  • performance-schema-logger: defines the default values for loggers. This can be defined multiple times, similarly to --performance-schema-instrument.

    In the following example, all loggers are configured with the error level ERROR, except foo and bar which are configured to error level INFO and WARNING, respectively:

                  --performance-schema-logger = 'logger/% = Level:ERROR' --performance-schema-logger = 'logger/foo/% = Level:INFO' 
                  --performance-schema-logger = 'logger/bar/% = Level:WARNING'

    To see the configured loggers, run the following:

    select * from performance_schema.setup_loggers;
    +------------------------+-------+-------------------------+
    | NAME                   | LEVEL | DESCRIPTION             |
    +------------------------+-------+-------------------------+
    | logger/sql/error_log   | info  | MySQL error logger      |
    | logger/sql/slow_log    | info  | MySQL slow query logger |
    | logger/sql/general_log | info  | MySQL general logger    |
    +------------------------+-------+-------------------------+

    This example shows the default MySQL error logger. This can be set to one of the following values:

    • none

    • error

    • warn

    • info

    • debug

    The following example changes the error logging level to WARNING:

    mysql> UPDATE performance_schema.setup_loggers
           SET LEVEL='WARN'
  • performance_schema_max_logger_classes: this system variable can also be set from the command line. For example:

                  --performance_schema_max_logger_classes=100

    Editing this value requires a server restart.