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:
-
log_syslog: Enable this variable to send the error log to the system log. (On Windows,log_syslogis enabled by default.)If
log_syslogis enabled, the following system variables can also be used for finer control. log_syslog_facility: The default facility forsyslogmessages isdaemon. Set this variable to specify a different facility.log_syslog_include_pid: Whether to include the server process ID in each line ofsyslogoutput.log_syslog_tag: This variable defines a tag to add to the server identifier (mysqld) insyslogmessages. If defined, the tag is appended to the identifier with a leading hyphen.
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.
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= to mysqld_safe, which then arranges for mysqld to write messages to a log file. To use file_namesyslog, specify the --syslog option. For syslog output, a tag can be specified with --syslog-tag=; this is appended to the tag_valmysqld server identifier with a leading hyphen.
© 2025 Oracle
Licensed under the GPLv2 License.