I have customized kafka server and the app is creating log files and configures log rotation. My problem is that I need to compress the rotation logs that were created.
I tried to create new log rotation file on /etc/logrotate.d with the following configuration:
/opt/kafka/logs/server.log.* {
monthly
compress
dateext
dateformat _%Y-%m-%d
extension .tar.gz
missingok
ifempty
}
With this configuration I cannot compress my old files, and the message is: log does not need rotating (log has been already rotated).
Thanks for your help :-)