0

I started using logrotate a few days ago on a new server setup (actually three of them). My config is as follows.

/var/www/mywebsite.com/logs/*.log {
    rotate 14
    daily
    dateext
    compress
    delaycompress
    sharedscripts
    postrotate
        /usr/sbin/apache2ctl graceful > /dev/null
    endscript
}

Problem is that this is putting several days of logs into the same file. For example, I've currently got a file called access.log-20121005 which has logs for Oct 3rd, Oct 4th and Oct 5th in it. Is that proper behaviour? What I want for it to do is to create one logfile for each day and keep 14 days of logs.

Any help appreciated, thanks.

2 Answers 2

0

Oct 3rd, Oct 4th and Oct 5th in it. Is that proper behaviour?

Why will you splitt the log every day? There are lot's of analysing tools to query your whishes ... on my productive system the log-rotate is monthly (on the high performed systems weekly) ...

A short overview about analysing-tools you find here http://robert.boeck-horn.de/logfile-analyzer.php (Overview in german, landing pages english)

1
  • 1
    Doesn't matter my reasons, I just want to know if it's proper configuration and - if not - how would I do it?
    – user84273
    Oct 5, 2012 at 10:42
0

Turns out it was working correctly. The reason it put three days is because it had been running for two days prior and just put everything in the first log. Appears to be splitting correctly now, apart from the fact that it's running at 6am or something so we get six hours worth of logs in the wrong date, but that's fine.

You must log in to answer this question.