As part of my ongoing efforts to make sites on this server run faster and cause me fewer headaches I’ve implemented Apache log rotation using Cronolog.
Apache2 does support log rotation, but Cronolog gives you more options, which is why I chose it.
On Ubuntu all you need to do is:
apt-get install cronolog
To see which version you have type:
cronolog -V
The version I have is 1.6.2, which was released 5 years ago! I guess that means “it just works”.
Unfortunately the documentation on the site isn’t as extensive as I would have liked, but adding a daily log rotation in Apache2 can be done by editing the log entry in the vhost config to read as follows:
CustomLog "|/usr/sbin/cronolog /pathtologs/logs/%Y/%m/%d/access.log" combined
This will create a subdirectory for each year, month and day. As the site I was concerned about, IrishBlogs.info, produces rather large log files I was more concerned about getting them down to a managable size. I am not worried about processing them at this juncture.
Hopefully this will help 🙂
Frank Michlick says
Now that we are talking logs, what do you use for stats. I am looking for something I can host myself without giving all of my data to someone else, and cheap 😉
I like Webalizer and awstats, however neither one really provides usable stats across many different domains… Like an overview screen that shows all of my domains and then drill down options from there.
Any ideas?
Thanks,
/Frank
michele says
Frank
Have you ever looked at Sawmill?
Michele
Apache says
I’ve used cronolog in the past over other log-apps due to the ability of being able to use/create a formated dir structure for the logs and rotating logs on a date change vs. some timer countdown.
It does have problems though. Its been a while since a new release and it has problems with Apache restart.
Gokul.S.Kartha says
today i tried cronolog for rotating my catalina.out file,its looking good.Is there any patches available for pattern searching stuff?
Reagrds,
Gokul.S.Kartha
Software Engineer
DeviceDriven
Technopark
michele says
Gokul
Cronolog is for rotating logs not analysing them
Michele
Andrew Ford says
Michele: In what way is the cronolog documentation deficient? Let me know and I will try to address those deficiencies.
Also a new version of cronolog is in the works (it will be out soon – I promise).
michele says
Andrew
More examples of usage would be helpful. At the moment there’s very little on there 🙂
Thanks for your comment and I look forward to the new version as soon as it’s available for Ubuntu
Michele