I have set the following configuration for logrotate in /etc/logrotate.d/my-app
- Code: Select all
/path/to/my-app/debug.log {
rotate 3
maxsize 100M
dateext
dateformat -%d-%m-%Y
maxage 31
}
But the result is not being what I expected. What I want is that debug.log file don't exceed 100MB and when 100MB are reached, a new debug.log file is created, and when there are 3 old debug files (100MB each), the older one gets deleted to be able to save a newer one. Instead, this is what I am getting:
- Code: Select all
0 Feb 20 00:00 debug.log
447M Feb 15 08:47 debug.log-14-02-2021
868M Feb 18 21:49 debug.log-16-02-2021
418M Feb 20 21:23 debug.log-20-02-2021
So, is this wrong for what I want to do or what am I missing?