MySQL 5.7 Reference Manual Including MySQL NDB Cluster 7.5 and NDB Cluster 7.6

5.4.2.3 Error Logging to the System Log

It is possible to have mysqld write the error log to the system log (the Event Log on Windows, and syslog on Unix and Unix-like systems). To do so, use these system variables:

Note

Error logging to the system log may require additional system configuration. Consult the system log documentation for your platform.

On Unix and Unix-like systems, control of output to syslog is also available using mysqld_safe, which can capture server error output and pass it to syslog.

Note

Using mysqld_safe for syslog error logging is deprecated; you should use the server system variables instead.

mysqld_safe has three error-logging options, --syslog, --skip-syslog, and --log-error. The default with no logging options or with --skip-syslog is to use the default log file. To explicitly specify use of an error log file, specify --log-error=file_name to mysqld_safe, which then arranges for mysqld to write messages to a log file. To use syslog, specify the --syslog option. For syslog output, a tag can be specified with --syslog-tag=tag_val; this is appended to the mysqld server identifier with a leading hyphen.