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
}
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