Hitachi

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


2.6.1 rotatelogs

rotatelogs splits logs by time and outputs them into multiple files.

Description

rotatelogs splits the access log or the error log by time (for example, in unit of 24 hours) and output the log into multiple files. You can specify the rotatelogs program in the following directives:

Syntax

rotatelogs prefix_of_log_files_to_be_generated_after_the_split time_interval_for_splitting_log
    [-fnum number_of_files] [-diff time_difference_from_GMT]
prefix_of_log_files_to_be_generated_after_the_split

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.nnnnnnnnnn.

nnnnnnnnnn indicates the starting time when the log was obtained. The following formula is used to calculate the time when the log was obtained:

[Figure]

time_interval_for_splitting_log

Specify the time interval (in seconds) for obtaining a log file. The log is collecting into a new file when the specified time elapses.

Specifiable values

1 to 31536000

-fnum number_of_files

Specify the maximum number of log files that can exist after the split. If the number of log files generated after the split exceeds this number, files are deleted in order from the oldest file. If this option is omitted, no files are deleted.

Specifiable values

1 to 256

-diff time_difference_from_GMT

Specify the time difference (in minutes) from GMT, which is used as the basic time for splitting the log file. If nothing or 0 (zero) is specified, the basic time is January 1, 1970, 00:00:00 (GMT). If the time difference between GMT and the local time is n hours and you want to set the m:00:00 (local time) as the basic time, specify the value obtained from the formula (n-m)*60. If you want to set 00:00:00 JST as the basic time, specify 540, which is calculated by the formula (+9-0)*60.

Specifiable values

-1439 to 1439

Storage location

installation_directory_for_Application_Server/httpsd/sbin

Example

Specify the directive by using the "|program_name" format. The log file will be split and collected into separate files at regular intervals.

At 24-hour intervals, the access log is split and log entries are collected into the file installation_directory_for_Application_Server/httpsd/logs/access.nnnnnnnnnn. In the following example, the log file is split every day at midnight (00:00:00), Japan time:

TransferLog "|installation_directory_for_Application_Server/httpsd/sbin/rotatelogs installation_directory_for_Application_Server/httpsd/logs/access 86400 -diff 540"

Notes