NonStop Servlets for JavaServer Pages (NSJSP) 6.1 System Administrator's Guide

Logging in NSJSP
NonStop Servlets for JavaServer Pages (NSJSP) 6.1 System Administrator’s Guide596210-006
5-8
Log Rollover
Log Rollover Based on File Size
Log Rollover Based on Timestamp
The archiveDirectory Attribute
Log Rollover Based on File Size
The maxFileSize attribute governs the size-based rollover of log files. You can
configure a threshold file size for log rollover. This value must be greater than zero. If
the file size exceeds the specified threshold, the log file rolls over. The base threshold,
which is the lower limit to archive the log files, is 10 MB. If you set the maxFileSize
attribute to a value less than 10 MB, the log file rolls over only when the size exceeds
10 MB. For example, if you set the value to 8 in the logging.properties file, the
roll over occurs when the file size exceeds 10 MB, which is the minimum size of the log
file to trigger a roll over. However, if you set the maxFileSize attribute to a value
greater than 10, the log file rolls over only when its size exceeds the set value. If the
value of the maxFileSize attribute is equal to or less than zero, it is considered an
invalid value, and the size-based rollover feature is disabled. When the value of the
maxFileSize attribute is invalid, an error message is logged to STDERR.
Upon rollover, the log file name is appended with the date and time of rollover.
For example, if the user-defined name of the log file is abc.log, and it rolls over at
02.00.30 hours on August 30th, 2008, the rolled over log file is renamed to
abc.log.2008.08.30.02.00.30, where 2008.08.30.02.00.30 is the
timestamp. After abc.log.2008.08.30.02.00.30 rolls over, a new log file is
created. This log file becomes the current working log file, and is assigned the user-
defined log file name, abc.log. Similarly, when this current working log file rolls over,
the date and time are appended to the file name, and a new working log file is created,
called abc.log. Therefore, the name of the current working file is always the user-
defined file name.
Log Rollover Based on Timestamp
The datePattern attribute in the logging.properties file governs the
timestamp-based rollover of log files. You can configure the log file to roll over at
predefined time intervals using the datePattern attribute value. The datePattern
attribute value must adhere to the format specified in the Java class documentation at:
http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html
.
In timestamp-based rollover, when a log file is created, the log file name is appended
with the current date, which is according to the format specified in the
java.text.SimpleDateFormat Java class documentation.
For example, if a log file, called nsjsp.log, is created on August 30th, 2008, the
complete log file name will be nsjsp.log.2008.08.30. The second part of the file
name, 2008.08.30, which corresponds to August 30th, 2008 is automatically
appended to nsjsp.log.
Note. The unit, MB is taken by default. You must specify only the file size.