Setting Up Rolling Log Files

Use this procedure to set up the log files so that new files are created based on a number of days or on the file size. This can prevent individual log files from becoming too large.

A roll to a new file is only triggered when the system writes a log message. For example, if the number of days is set to 1 and a new day has started, a new log file is not created until the system writes a new message. For a roll to a new file to occur based on file size, the file is rolled if the size is greater than or equal to the roll size before the system attempts to write the log message. That is, the system does not include the size of the current message. If the writing of a message causes the file size to equal or exceed the roll size, then a new log file is created upon the writing of the next message.

If you set both the number of days and the size parameters, then rolling occurs based on whichever event occurs first. If you set neither, then no rolling occurs (the effect is just as if you were using the standard log file publisher).

To set up rolling log files

  1. Open the configuration file for the log files you want to set up to roll. For a list of configuration files, see Log Configuration Files .
  2. In the log publishers section, change the reference com.lawson.logging.LogFilePublisher to com.lawson.logging.RollingLogFilePublisher.
  3. Edit the following parameters. All but the file parameter are optional, but if you set neither a number of days or size parameter, no rolling will occur.
    Parameter Description
    <Parameter value="file=filename"/> The name of the log file (set to a default value by the installation).
    <Parameter value="days=numberOfDays"/> Indicate the number of days to trigger to roll to a new log file
    <Parameter value="size=size+sizeSuffix"/>

    Enter a size plus the appropriate size suffix ("b" for bytes, "k" or "kb" for kilobytes, "m" or "mb" for megabytes, and "g" or "gb" for gigabytes)

    For example, 100000b, 1000k or 1000kb, 10m or 10mb, 1g or 1gb

    <Parameter value="timezone=timezone"/> Use in conjunction with the number of days. It sets an alternate time zone to use to determine when the day changes.
  4. Save your changes and close the file.