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_syslog
is enabled by default.)If
log_syslog
is enabled, the following system variables can also be used for finer control.log_syslog_facility
: The default facility forsyslog
messages isdaemon
. Set this variable to specify a different facility.log_syslog_include_pid
: Whether to include the server process ID in each line ofsyslog
output.log_syslog_tag
: This variable defines a tag to add to the server identifier (mysqld
) insyslog
messages. 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_name
syslog
, specify the
--syslog
option. For
syslog
output, a tag can be specified with
--syslog-tag=
;
this is appended to the tag_val
mysqld
server
identifier with a leading hyphen.