List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:May 16 2010 4:51am
Subject:Re: MySQL and Syslog
View as plain text  
In the last episode (May 15), James Corteciano said:
> Hi All,
> Anyone had tried to push all MySQL logs to the centralized syslog server?
> Can you share with me how did you do it?
> I have centralized syslog (rsyslog-3.22.1-3.el5) server who resides
> separately and a remote MySQL server (mysql-server-5.0.77-4.el5_4.2) on
> other node. How to accomplish this to work smoothly that all logs of MySQL
> will be forwarded to the syslog?

Best solution is to upgrade to mysql 5.1 and pass --syslog to mysqld_safe when
starting mysql:

Next best solution:

  tail -F -n 0 /path/to/mysql.err | logger -p daemon.notice -t mysql 

Run that before starting mysql, and any lines written to the log file will
get redirected to syslog.

	Dan Nelson
MySQL and SyslogJames Corteciano15 May
  • Re: MySQL and SyslogDan Nelson16 May