Parece que a sobregravação de regras foi implementada e funciona agora:
$ logrotate --version
logrotate 3.8.7
$ cat /etc/logrotate.d/test
# rotate application logs for 40 days by default
/home/myapp/log/*.log
/home/myapp/log/*/*.log
{
daily
compress
delaycompress
rotate 40
}
# rotate access logs for 1 year
/home/myapp/log/access/*.log {
daily
compress
delaycompress
rotate 365
}
$ logrotate -d /etc/logrotate.d/test
reading config file /etc/logrotate.d/test
Handling 2 logs
rotating pattern: /home/myapp/log/*.log
/home/myapp/log/*/*.log
after 1 days (40 rotations)
empty log files are not rotated, old logs are removed
No logs found. Rotation not needed.
rotating pattern: /home/myapp/log/access/*.log after 1 days (365 rotations)
empty log files are not rotated, old logs are removed
No logs found. Rotation not needed.
Enquanto testado no meu logrotate local (versão 3.7.8), o erro foi levantado:
$ cat logr.conf
# rotate application logs for 40 days by default
/home/myapp/log/*.log
/home/myapp/log/*/*.log
{
daily
compress
delaycompress
rotate 40
}
# rotate access logs for 1 year
/home/myapp/log/access/*.log {
daily
compress
delaycompress
rotate 365
}
$ logrotate -d logr.conf
reading config file logr.conf
reading config info for /home/myapp/log/*.log
/home/myapp/log/*/*.log
error: logr.conf:12 duplicate log entry for /home/myapp/log/access/api_access.log
error: found error in /home/myapp/log/access/*.log , skipping
removing last 1 log configs
...