Error Log for MariaDB Community Server 10.4

Overview

MariaDB Community Server 10.4 writes log messages to its error log.

Reference material is available for MariaDB Community Server 10.4.

Purpose

The error log is intended for:

  • Monitoring the ES system status

  • Diagnosing problems with queries

  • Diagnosing communication problems between Galera Cluster nodes

  • Diagnosing connection failures

Format

The error log uses the following log format:

timestamp thread id [logging level] message

The fields in each log message are:

Field

Description

timestamp

The timestamp for the log message in the format YYYY-MM-DD HH:MM:SS

thread id

The thread ID

logging level

The log level for the log message

message

The log message.

Log Levels

The error log uses the following log levels in the logging level field:

  • Error

  • Note

  • Warning

Location

By default, the error log is located in the data directory defined by the datadir system variable, and the error log's file name is HOSTNAME.err, where HOSTNAME is the system's host name.

You can determine the error log's file name and location by querying the log_error system variable:

SHOW GLOBAL VARIABLES
   LIKE 'log_error';

Configuration

Several aspects of the error log are configurable.

Configure the Path

The path to the error log is configured by setting the log_error system variable.

The system variable can be set in a configuration file:

[mariadb]
log_error=mariadbd.err

The error log will be created in the data directory defined by the datadir system variable.

The error log can be placed outside of the data directory by setting the log_error system variable to the absolute path of the desired location:

[mariadb]
log_error=/var/log/mariadb/mariadbd.err

If the log_error system variable is set, but no value is provided, the path to the error log is set to HOSTNAME.err, where HOSTNAME is the system's host name:

[mariadb]
# base name on the system's host name
log_error

Configure the Verbosity Level

The verbosity of the error log is configured by the log_warnings system variable.

The verbosity can be between 0 and 9.

The system variable can be set in a configuration file:

[mariadb]
log_warnings=3