To rotate your IBM HTTP Server logs (or Apache HTTP server logs) on a daily (or whatever) basis, you normally are using something like

The disadvantage of that is, that the current log file name changes every day. So if you have e.g. a log viewer open to watch the log file, you need to adapt that file name  every day.

A better solution for that is a tool called "cronolog". It can be used in a similar way like

It then creates a directory with the date as the name and places the log file of that day inside that directory. In addition it creates a symbolic link with the original name ("access_log") and also a symbolic name to the log file of the day before ("access_log_before").

Both file names will not change and therefore can be monitored without changing anything in the log viewer.

The tool should be part of all Linux distributions and can be installed e.g. with "yum -y install cronolog" (for  Redhat; use the package install command for your distribution instead).

IBM HTTP Server: Better logrotate for HTTP server logs in Linux
Tagged on:             

Leave a Reply

Your email address will not be published. Required fields are marked *