Hitachi

Hitachi Application Server V10 User's Guide (For Windows® Systems)


10.2.1 Log file rotation methods

The log data for each process is output to multiple files in rotation. The files to which log data is to be output are switched at a specified time or when the size of the output-destination file reaches a specified size. The log rotation methods are described below.

Log rotation method for a Java EE server

If the log file to which log data is output is named prf_message01, when the first switch occurs, this file is renamed prf_message02. A new log file named prf_message01 is created, and then log data is output to the newly created file. When the second switch occurs, prf_message01 is renamed prf_message02, and prf_message02 is renamed prf_message03. A new log file named prf_message01 is created, and then log data is output to the newly created file. When the number of log files exceeds a specified number, a file that has the largest number is deleted.

Log rotation method for a web server

You can specify how to split log files by using the rotatelogs or rotatelogs2 program. Specify the split method in the definition file of the web server.

rotatelogs program

The access log or error log can be output to multiple files by splitting the data at a specified time interval (for example, every 24 hours).

  • Log split time interval

    Specify the amount of time for which data is to be collected to a single log file. After the specified time elapses, log data will be collected to a new file.

  • Number of files

    Specify the number of files among which the output log data is to be split. When the number of files exceeds the specified number, the oldest file will be deleted.

rotatelogs2 program

The access log or error log can be split based on the size of the log file and then output to multiple files by using the wraparound method.

  • Log file size

    Specify the maximum size (in kilobytes) of a log file. If the size of a file exceeds the maximum size when log data is output, the next file in the rotation is cleared, and then the log data is output to that file.

  • Number of log files

    Specify the maximum number of log files to which data is to be output. When the size of a log file exceeds the maximum size, the log file is switched. In such a case, if the extension of the log file to which data was last output is equal to the maximum number of log files, when the log file is switched, data will be output to the first log file.

    Example: If 3 is specified for the number of log files

    If a log file is errorlog.001, log data is output sequentially from errorlog.001 to errorlog.003. When the size of errorlog.003 exceeds the maximum file size, is cleared, and then the remaining log data is output to errorlog.001.

Log rotation method for performance tracer

The most recent file is always named prf_message01. When the first switch occurs, prf_message01 is renamed prf_message02. When the second switch occurs, prf_message01 is renamed prf_message03. (Note that prf_message02 is not renamed prf_message03.)

Log rotation method for the application development environment

Based on the file size, the log file to which log data is to be output is renamed.