Sun GlassFish Enterprise Server v3 Prelude Administration Guide

ProcedureTo Set Handler-Specific Properties

You can modify logging behavior by setting properties in the logging.properties file as follows:

  1. In a text editor, find the property that you want to modify and make your changes.

    The following properties are available:

    File Description

    Contains the name and location of the log file. By default, the name is server.log and the location is the logs directory. These can be changed.

    com.sun.enterprise.server.logging.FileandSyslogHandler.file=logs/server.log
    File Rotation Time Limit

    Rotates the log file based on time in minutes. If defined, time limit takes precedence over size limit. If set to 0 (the default), there is no rotation based on time.

    com.sun.enterprise.server.logging.FileandSyslogHandler.rotationTimelimitInMinutes=0
    File Rotation Size Limit

    Rotates the log file based on limit in bytes. If set to 0 (the default), there is no rotation based on file size. 500000 is the minimum.

    com.sun.enterprise.server.logging.FileandSyslogHandler.rotationLimitInBytes=0
    Formatter

    Uses UniformLogFormatter to format the records in the log file.

    com.sun.enterprise.server.logging.FileandSyslogHandler.formatter=com.
    sun.enterprise.server.logging.UniformLogFormatter
  2. Save the file.

  3. To apply your changes, restart Enterprise Server.

    1. Stop Enterprise Server.

      For instructions, see To Stop a Domain (or Server).

    2. Start Enterprise Server.

      For instructions, see To Start a Domain (or Server).


Example 9–1 Changing a Handler-Specific Logging Property

The following example changes the rotationTimelimitInMinutes from 0 (the default) to 90 minutes:

Before:


com.sun.enterprise.server.logging.FileandSyslogHandler.rotationTimelimitInMinutes=0

After: :


com.sun.enterprise.server.logging.FileandSyslogHandler.rotationTimelimitInMinutes=90