Re: MySQL general logs to syslog
Lew Pitcher <[email protected]> Mon, 19 Oct 2020 18:49:59 -0000 (UTC)
| Newsgroups | comp.databases.mysql |
|---|---|
| Organization | The Pitcher Digital Freehold |
| Message-ID | <[email protected]> |
On Mon, 19 Oct 2020 00:21:42 -0700, rana chand wrote: > Hi All, > > Currently all MySQL error logs and general logs are stored in > /var/log/mysql/error.log and /var/log/mysql/mysql.log > > I want to redirect these logs to syslog. So, I have addes the following > to the configuration file of mysql: > > [mysqld] > log-syslog = on > > Now only MySQL error logs are only redirected to the syslog. > Is there a way to redirect both the error and general logs to syslog. Apparently, not from within mysqld. According to https://dev.mysql.com/doc/refman/5.7/en/query-log.html the "General Query Log" can only be directed to a file or a mysql table (or both a file and a table), or not output at all. From the syslog side, syslogd /can/ read from a UNIX-domain socket (if configured to do so), so you /might/ be able to direct the general query- log to a "file", with that file being a UNIX-domain socket input known to syslogd. I don't know if this will work; I've never tried it. -- Lew Pitcher "In Skills, We Trust"