Use cronolog to Rotate Your Web Server Log Files. The cronolog program reads log messages from its input and writes them to a set of output files, the names of which are constructed using template and the current date and time. The template uses the same format as the UNIX date command (which are the same as the standard C strftime library function).

Installation

To install cronolog, connect to your Virtual Private Server via Telnet or SSH and run this command:

  • % vinstall cronolog

Usage

cronolog is intended to be used in your Web Server Configuration File (~/www/conf/httpd.conf) to split the access log file, or other log files, into daily or monthly log files, like in the following example.

TransferLog "|/usr/local/cronolog/cronolog /www/logs/%Y/%m/%d/access.log" 
ErrorLog    "|/usr/local/cronolog/cronolog /www/logs/%Y/%m/%d/errors.log"

The sample configuration directives above instruct Apache to pipe its access and error log messages into separate copies of cronolog, which would create new log files each day in a directory hierarchy structured by date, so that on 31 December 1996 (for example) messages would be written to the following files.

~/www/logs/1996/12/31/access.log
~/www/logs/1996/12/31/errors.log

After midnight the following filenames would be written, with the directories 1997, 1997/01 and 1997/01/01 being created if they did not already exist.

~/www/logs/1997/01/01/access.log
~/www/logs/1997/01/01/errors.log

Please note: the information on this page applies to ITS web hosting plans. It may or may not apply to other environments. If you are looking for a feature described here, or better support from your hosting provider, please consider hosting your site with ITS!

1555 N Naperville/Wheaton Road, Suite 107
Naperville, IL 60563
phone 630.420.2550
fax 630.420.2771