I usually create my access and error logs in a domain-name folder under /var/log
, and these files are rotated with logrotate using this conf :
/var/log/mydomain.org/access.log
{
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
prerotate
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=mydomain.org &> /dev/null
endscript
postrotate
if [ -f /var/run/apache2.pid ]; then
/etc/init.d/apache2 restart > /dev/null
fi
endscript
}
I have regularly this problem : my access.log
is rotated to access.log.1
, but apache2 keeps on logging access on access.log.1
.
I can't figure out why this is happening. Any help ?
Thanks in advance.
logrotate --debug /etc/logrotate.d/YOURFILE
?