4.2.4 Reusing the log files by wrapping around (rotatelogs2 program)

You can split the access log and error log based on the log file size and output them to multiple log files by wrap around. The rotatelogs2 program can be specified in the following directives:

Specify the program in the following format.

Organization of this subsection
(1) Format
(2) Parameters
(3) How to use
(4) Notes

(1) Format

rotatelogs2 Log-file-prefix-name Log-file-size Number-of-log-files

(2) Parameters

(3) How to use

Specify the rotatelogs2 utility by using the |program-name format in directives.

Example: Collecting a maximum number of five error log files for every 4,096 KB

ErrorLog "|\"\"<Cosminexus-installation-directory>/httpsd/sbin/rotatelogs2.exe\" \"<Cosminexus-installation-directory>/httpsd/logs/errorlog\" 4096 5\""

The log is output in the sequence of errorlog.001 ~ errorlog.005. If the errorlog.005 exceeds 4,096 KB, errorlog.001 is cleared and output is continued. If these log files already exist when Cosminexus HTTP Server starts, the last updated log file is output. If the size of this log file already exceeds 4,096 KB, the next log file is cleared and the log output is continued. When the file size does not exceed 4,096 KB, the output is continued to the same file.

(4) Notes

(a) Notes for the UNIX version
(b) Notes for the Windows version
(c) Common notes for the UNIX and Windows versions