Bug 533736 - RFE: allow logging to syslog
Summary: RFE: allow logging to syslog
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mysql
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Tom Lane
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-11-08 20:24 UTC by Ruben Kerkhof
Modified: 2013-07-03 03:24 UTC (History)
2 users (show)

Fixed In Version: 5.1.40-1.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-12-11 18:16:12 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ruben Kerkhof 2009-11-08 20:24:26 UTC
Description of problem:

Since version 5.1.20, mysql has the --syslog option, to send error messages to syslog.

The only way to enable this a.t.m. is to remove the --log-error option from /etc/init.d/mysqld and replace it with --syslog. It would be great if I could specify a flag in /etc/sysconfig/mysqld to enable this.

Comment 1 Tom Lane 2009-11-10 15:15:22 UTC
Hm, why would you not want to set it in /etc/my.cnf?  There's no /etc/sysconfig file associated with mysql and I don't feel a need to introduce one ...

Comment 2 Ruben Kerkhof 2009-11-10 16:45:18 UTC
Hi Tom,

The init script explicitly sets the --log-error option, even if it's not defined in /etc/my.cnf, but --syslog and --log-error are mutually exclusive.

I have this in /etc/my.cnf:

[mysqld_safe]
pid_file = /var/run/mysqld/mysqld.pid
syslog

But this has no effect.

If log-error is not defined, the init script sets it to /var/log/mysqld.log, but it should only do this if either syslog is not defined or skip-syslog is defined.

Of course things would have been much easier if mysql just supported --log-error=syslog...

Comment 3 Tom Lane 2009-11-10 17:02:13 UTC
Well, what I think we can do is just remove the --log-error parameter from the mysqld_safe call.  In the default case, mysqld will pick up the setting from /etc/my.cnf anyway, and somebody who wants to change to syslog logging can just adjust my.cnf like you did.  The only reason the init script cares about the error log file is that it wants to make sure the file has the right permissions, and if the file is created but then mysql doesn't use it, no harm done.

Comment 4 Ruben Kerkhof 2009-11-10 21:13:25 UTC
That sounds like a solid solution to me.

Comment 5 Fedora Update System 2009-11-11 04:07:00 UTC
mysql-5.1.40-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/mysql-5.1.40-1.fc12

Comment 6 Fedora Update System 2009-11-11 04:07:05 UTC
mysql-5.1.40-1.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/mysql-5.1.40-1.fc11

Comment 7 Fedora Update System 2009-11-12 00:52:01 UTC
mysql-5.1.40-1.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mysql'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-11399

Comment 8 Fedora Update System 2009-11-12 00:55:53 UTC
mysql-5.1.40-1.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mysql'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-11422

Comment 9 Fedora Update System 2009-12-11 18:16:07 UTC
mysql-5.1.40-1.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2009-12-11 18:37:04 UTC
mysql-5.1.40-1.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.