[debian-mysql] [PATCH 5/8] Write an error log and logrotate it

Robie Basak robie.basak at canonical.com
Mon Feb 10 13:50:18 UTC 2014


d/{additions/my.cnf,mysql-server-5.5.mysql-server.logrotate}: ensure
mysql errors are written to log file.

Errors being logged to syslog only makes it hard to triage bugs. In
Ubuntu, we've been logging (and rotating) errors to
/var/log/mysql/error.log in addition, to ease both diagnostics and bug
triaging. This makes sense for Debian, too.

Bug-Ubuntu: https://launchpad.net/bugs/1014732
---
 debian/additions/my.cnf                        | 4 +++-
 debian/mysql-server-5.5.mysql-server.logrotate | 3 +--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/debian/additions/my.cnf b/debian/additions/my.cnf
index 1f96915..4df5bd0 100644
--- a/debian/additions/my.cnf
+++ b/debian/additions/my.cnf
@@ -72,7 +72,9 @@ query_cache_size        = 16M
 #general_log_file        = /var/log/mysql/mysql.log
 #general_log             = 1
 #
-# Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf.
+# Error log - should be very few entries.
+#
+log_error = /var/log/mysql/error.log
 #
 # Here you can see queries with especially long duration
 #log_slow_queries	= /var/log/mysql/mysql-slow.log
diff --git a/debian/mysql-server-5.5.mysql-server.logrotate b/debian/mysql-server-5.5.mysql-server.logrotate
index 83550bf..b3fb701 100644
--- a/debian/mysql-server-5.5.mysql-server.logrotate
+++ b/debian/mysql-server-5.5.mysql-server.logrotate
@@ -1,8 +1,7 @@
 # - I put everything in one block and added sharedscripts, so that mysql gets 
 #   flush-logs'd only once.
 #   Else the binary logs would automatically increase by n times every day.
-# - The error log is obsolete, messages go to syslog now.
-/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log {
+/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/error.log {
 	daily
 	rotate 7
 	missingok
-- 
1.8.3.2




More information about the pkg-mysql-maint mailing list