/var/log/mysql/mysqld.log {
     create 600 mysql mysql
     notifempty
     daily
     rotate 5
     missingok
     compress
   postrotate
   # just if mysqld is really running
     if test -n "`ps acx|grep mysqld`"; then
           mysql -e 'SET SQL_LOG_BIN=OFF;FLUSH ERROR LOGS'
     fi
   endscript
}


/var/log/mysql/mysql-slow.log {
     nocompress
     create 660 mysql mysql
#     size 256M
     daily
     dateext
     missingok
     notifempty
     sharedscripts
     postrotate
           mysql -e 'select @@global.long_query_time into @lqt_save; set global long_query_time=2000; select sleep(2);SET SQL_LOG_BIN=OFF;  FLUSH SLOW LOGS; select sleep(2); set global long_query_time=@lqt_save;'
     endscript
     rotate 30
}
