cronolog features

Started by sukishan, Aug 22, 2009, 07:04 PM

Previous topic - Next topic

sukishan

cronolog features
cronolog is a simple filter program that reads log file entries from standard input and writes each entry to the output file specified by a filename template and the current date and time. When the expanded filename changes, the current file is closed and a new one opened. cronolog is intended to be used in conjunction with a Web server, such as Apache, to split the access log into daily or monthly logs. For example the Apache configuration directives:
TransferLog "|/usr/sbin/cronolog /web/logs/%Y/%m/%d/access.log"
ErrorLog    "|/usr/sbin/cronolog /web/logs/%Y/%m/%d/errors.log"

would 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, i.e. on 31 December 2002 messages would be written to
/web/logs/2002/12/31/access.log
/web/logs/2002/12/31/errors.log

after midnight the files
/web/logs/2003/01/01/access.log
/web/logs/2003/01/01/errors.log
A good beginning makes a good ending