MySQL Variables log_syslog 数据库 参数变量解释及正确配置使用
本站中文解释
log_syslog是Mysql server 服务的一个参数变量,用来控制是否将MySQL服务的消息发送到系统日志文件或者远程syslog服务,可以设置为值0或者1,如果设置为1则可以将MySQL的消息发送到系统日志中。默认情况下,该变量成设置为0,未开启将MySQL消息发送到日志中。
为设置log_syslog ,需要在/etc/my.cnf中添加或修改如下配置:
log_syslog = 1
官方英文解释
log_syslog
Command-Line Format | --log-syslog[={OFF|ON}] |
---|---|
System Variable | log_syslog |
Scope | Global |
Dynamic | Yes |
Type | Boolean |
Default Value (Unix) | OFF |
Default Value (Windows) | ON |
Whether to write error log output to the system log. This is
the Event Log on Windows, and syslog
on
Unix and Unix-like systems. The default value is platform
specific:
-
On Windows, Event Log output is enabled by default.
-
On Unix and Unix-like systems,
syslog
output is disabled by default.
Regardless of the default,
log_syslog
can be set
explicitly to control output on any supported platform.
System log output control is distinct from sending error
output to a file or the console. Error output can be directed
to a file or the console in addition to or instead of the
system log as desired. See Section 5.4.2, “The Error Log”.