Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

/var/www/*.log {
    rotate 14
        /usr/sbin/apache2ctl graceful > /dev/null

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.

share|improve this question

migrated from Oct 17 '12 at 23:01

This question came from our site for professional and enthusiast programmers.

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 (Overview in german, landing pages english)

share|improve this answer
Doesn't matter my reasons, I just want to know if it's proper configuration and - if not - how would I do it? – Felthragar Oct 5 '12 at 10:42
up vote 0 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.