Hitachi

Hitachi Application Server V10 Definition Reference Guide (For UNIX® Systems)


2.6.2 rotatelogs2

rotatelogs2 splits logs by file size and outputs them into multiple files.

Description

rotatelogs2 splits the access log or the error log by log file size, and output the log into multiple files by using the wraparound method. You can specify the rotatelogs2 program in the following directives:

Syntax

rotatelogs2 prefix_of_log_files log_file_size
    number_of_files
prefix_of_log_files

Specify the prefix, as an absolute path, of the log files to be generated after the split.

Logs will be collected into files whose names are in the format prefix.nnn.

nnn is the number of log files, from 001 to the number specified in number_of_files.

If the number of log files is nnn, among the nnn files, the file that had the latest update time when the web server started will be the current log file. The log files are distinguished from other files by adding an extension, from 001 to nnn, to the prefix file name. If the extension of the current log file is mmm and the current log file becomes full, the log file becomes mmm+1, the content of this log file is cleared, and the log is output to this log file. If nnn is the same as nnn, the log is output to the log file 001.

log_file_size

Specify the maximum size of a log file (unit: KB).

If the log file reaches the maximum size when a log entry is output to the log file, the program clears the next log file and output continues to that file.

Specifiable values:

1 to 2097151

number_of_files

Specify the maximum number of log files to which the log will be output.

If the log file reaches the maximum size and output moves on to the next file, and if the extension of the process log files is the same as the maximum number of files, the program reuses the files from 001.

Specifiable values:

1 to 256

Storage location

installation_directory_for_Application_Server/httpsd/sbin

Example

Specify the directive by using the |program_name format.

Example: This example collects the log into a maximum of five error log files, each of which is a maximum of 4,096 KB:

ErrorLog "|\"\"installation_directory_for_Application_Server/httpsd/sbin/rotatelogs2.exe\" \"installation_directory_for_Application_Server/httpsd/logs/errorlog\" 4096 5\""

In the example, the log is output to the log files in the order from errorlog.001 to errorlog.005. If errorlog.005 reaches 4,096 KB, errorlog.001 is cleared and output continues to that log file. If these log files already exist when the web server starts, the last updated log file will be the log file targeted for output. If this log file already reaches 4,096 KB, the next log file is cleared and output continues to that log file. If the file size is less than 4,096 KB , output continues to the same file.

Notes