Default installation does not log to /var/log/mysql.err or mysql.log

Bug #185139 reported by Gargoyle
4
Affects Status Importance Assigned to Milestone
mysql-dfsg-5.0 (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Binary package hint: mysql-server-5.0

Although /var/log/mysql.err and mysql.log files are created, they remain empty. Messages are logged to /var/log/syslog

$uname -a
Linux mysql-01 2.6.22-14-server #1 SMP Sun Oct 14 22:09:15 GMT 2007 x86_64 GNU/Linux

$ mysql --version
mysql Ver 14.12 Distrib 5.0.45, for pc-linux-gnu (x86_64) using readline 5.2

My first bug report, hope its OK!

Revision history for this message
Nicolas Valcarcel (nvalcarcel) wrote :

Thanks for your report! And yes, as i see there is enought information about what is happening, we will take a look at it and solve it!

Revision history for this message
Nicolas Valcarcel (nvalcarcel) wrote :

Please can you add the output of: dpkg -l | grep mysql-server

Revision history for this message
Gargoyle (g-rgoyle) wrote :

matrix@mysql-01:~$ dpkg -l |grep mysql-server
ii mysql-server 5.0.45-1ubuntu3.1 MySQL database server (meta package dependin
ii mysql-server-5.0 5.0.45-1ubuntu3.1 MySQL database server binaries

Revision history for this message
Chuck Short (zulcss) wrote :

The default for ubuntu/debian is to log to syslog. If you want to log error messages to /var/log/msql.err you have to use safe_mysqld -lost-error=FILE.

Thanks
chuck

Changed in mysql-dfsg-5.0:
status: New → Incomplete
Chuck Short (zulcss)
Changed in mysql-dfsg-5.0:
status: Incomplete → Won't Fix
Revision history for this message
Gargoyle (g-rgoyle) wrote :

I thought the point of syslog was to log everything and then also have other things logged to different files by adding directives to /etc/syslog.conf. The logs for postfix seem to be going into both /var/log/syslog and /var/log/mail.log

Are there only special services that can be handled this way? or are we just missing some syslog.conf directives?

Revision history for this message
Mathias Gug (mathiaz) wrote : Re: [Bug 185139] Re: Default installation does not log to /var/log/mysql.err or mysql.log

On Mon, Feb 04, 2008 at 08:13:06PM -0000, Gargoyle wrote:
> Are there only special services that can be handled this way? or are we
> just missing some syslog.conf directives?

mysqld logs are also sent to /var/log/daemon.log.

--
Mathias Gug
Ubuntu Developer http://www.ubuntu.com

Revision history for this message
Gargoyle (g-rgoyle) wrote :

Sorry for digging up an old bug, but perhaps /var/log/mysql.err / .log need to be removed then?

Revision history for this message
Cameron Smith (cameron-ord) wrote :

I agree with Gargoyle. The /var/log/mysql.* logs should be removed as they cause a lot of confusion on Ubuntu admins. I also think that with this Ubuntu "improvement", the documentation should be clearer as to where syslog puts the mysql output by default. As it stands I find this "improvement" to be an "impediment", for someone who has long experience with mysql.

Revision history for this message
Gargoyle (g-rgoyle) wrote :

Wow! This bug is still alive and kicking - I had all but forgotten about it.

Since it's just over a year since I first reported it, lets see if we can come up with a fix/patch. I know almost nothing about how the apt packages work and even less about configuring syslog but I suspect for the people the do know each of these subjects, the following questions/tasks will probably have pretty short answers.

1.) The mysql-server package needs to be reconfigured to put mysql.err and mysql.log into the empty /var/log/mysql directory. Maybe the actual log files should just be called "error" and "info".

2.) logrotate needs to be updated to find the log files in the new locations.

3.) Syslog needs a configuration file/parameter to log mysql info to /var/log/mysql/mysql.err and /var/log/mysql/mysql.log

4.) Perhaps the default my.cnf file needs updating to suggest that users make use of the /var/log/mysql/ location for any other mysql related logging requirements.

Revision history for this message
Gargoyle (g-rgoyle) wrote :

Here is some updated system details for my latest hardy based server which still exhibits this behaviour:-

$ uname -a
Linux uc01 2.6.24-23-xen #1 SMP Thu Nov 27 20:14:09 UTC 2008 x86_64 GNU/Linux

$ mysql --version
mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (x86_64) using readline 5.2

$ dpkg -l |grep mysql-server
ii mysql-server 5.0.51a-3ubuntu5.4 MySQL database server (meta package dependin
ii mysql-server-5.0 5.0.51a-3ubuntu5.4 MySQL database server binaries

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.