/var/log/mysql/mysqld.log {
     create 600 mysql mysql
     notifempty
     rotate 5
     size 16M
     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 16M
     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 5
}


/var/log/prometheus/*_exporter.log {
    size 16M
    rotate 5
    copytruncate
    compress
    delaycompress
    missingok
}

/var/log/redis/redis*.log{
    size 16M
    rotate 5
    missingok
    compress
    delaycompress
    notifempty
    create 0660 root redis
}


