File Log Target

Description

The rotating file target provides support for a set of rotation strategies including rotation by size, rotation on data, and combined date/size rotation scenarios.

Example 1

    <file id="simple">
      <filename>logging.log</filename>
    </file>

Example 2

    <file id="simple">
      <filename>logging.log</filename>
      <append>true</append>
      <rotation type="revolving" init="1" max="10">
        <size>100k</size>
      </rotation>
    </file>

XML

Attributes Description
id The log target identifier.
Nested Element Description
filename The filename to assign to the log file.
append Optional element to control file appending policy on the startup of a new session. May contain 'true' or 'false'. If 'true' messages will be appended to the logging file otherwise a new file will be created.
rotation The <rotation> element holds a single child element that defines the rotation strategy. See Rotation Strategy Table for the set of available rotation strategies. A rotation element contains a type attribute that can be set to 'revolving' or 'unique'. If the type is set to 'revolving' then the 'init' and 'max' attributes will be assessed to determine the initial secquence number of the revolving file set, and max indicating the maximum number of files in the set.
format A standard formatter statement.

Rotation Strategy Elements

Element Description
size Rotate on size strategy. The default value is 2m (two megabytes). File size may be abrieviated with the 'm' for megabytes and 'k' for kilobytes.
date Rotate on date strategy. The value of the date element is a string in the date format YYYYMMDD.
interval Rotate on time interval strategy. The value of the interval element is a string in the format DDD:HH:MM:SS where the default value is 24:00:00.
time Rotate on time of day strategy. The value of the time element is a string in the format HH:MM:SS where the default value is 24:00:00. If you want to rotate a logfile more than once a day put an <or> element as the first element withing a <rotation> element and specify the times and a size element inside the <or> element.
or A composite strategy than combines any rotation strategy element declared as a chilkd of the <or> element.