Error Log
Contents
The error log contains a record of critical errors that occurred during the server's operation, tables corruption, start and stop information.
If the log-warnings server system variable is 1 (default), 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, aborted connections and access-denied errors for new connection attempts are also written to the error log.
On Unix systems which support the logger program, errors can also be written into syslog. This is done via mysqld_safe
's --syslog
options. 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
.
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.