The error log contains a record of critical errors that occurred during the server's operation, table corruption, start and stop information.

If the log-warnings server system variable is 1 (default), critical SQL warnings will be logged in the error log. If its value is 0, the logging of SQL warnings is disabled. If its value is greater than 1, Statements that were unsafe to log as statement-based, aborted connections and access-denied errors for new connection attempts are also written to the error log. For a complete list, see the description of the log-warnings variable.

On Unix systems which support the logger program, errors can also be written into syslog. This is done via mysqld_safe's --syslog option. daemon.err is used for all messages. By default, the mysqld and mysqld_safe tags are used; to add a suffix (which identifies the current instance of MariaDB), use --syslog-tag=tag. The tags will be mysqld-tag and mysqld_safe-tag.

systemd has its own logging system, and Linux distributions running systemd may log errors there instead. To view the systemd logs, use journalctl -u mariadb.

On Windows, the errors are also written in the Windows Event Log, in the Application Log. The source of the log enties is MySQL.

SQL errors can also be logged in a separate file using the SQL_ERROR_LOG plugin.

Activating the Error Log

The error log is active by default. The log-error=filename option determines where the output will be written. If no file name is specified, the log will be written to host-name.err. If no absolute path is specified, the file will be written to the data directory (determined by the value of the datadir system variable).

On Unix systems, if the --log-error option is not used, the errors are written to stderr (usually, the command line).

On Windows, if the --console option is specified, and --log-error is not used, the errors are written to the console. If --log-error is present, --console is ignored.


Until MariaDB 10.1.4, the format consisted of the date (yymmdd) and time, followed by the type of error (Note, Warning or Error) and the error message, for example:

160615 16:53:08 [Note] InnoDB: The InnoDB memory heap is disabled

From MariaDB 10.1.5, the date format has been extended to yyyy-mm-dd, and the thread ID has been added, for example:

2016-06-15 16:53:33 139651251140544 [Note] InnoDB: The InnoDB memory heap is disabled
MariaDB starting with 10.0.14

Suppressed error messages

Warnings about statements that are unsafe to use in statement-based replication can easily fill up the error log and even the disk. MariaDB 10.0.14 will automatically detect 'flooding of error messages' and after 10 identical unsafe error messages, disable these from being written to the error log for the next 5 minutes.


Comments loading...