Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Administration Guide

ProcedureTo configure general logging settings

You can use the com.sun.enterprise.server.logging.max_history_files system property to limit the number of rotated log files for both access logging and the server log. The property specifies the maximum number of access log files to keep, starting with the most recent ones.

In the Admin Console, access the config/server that this system property needs to be set for. On the command line, use the create-jvm-option command.

  1. In the tree component, expand the Node Agents or Configurations node.

  2. Select a node agent, or select the instance to configure:

    • To configure a particular instance, select the instance’s config node. For example, for the default instance, server, select the server-config node.

    • To configure the default settings for future instances that use a copy of default-config, select the default-config node.

  3. For a node agent, select the Logger Settings tab. For a configuration, select the Logger Settings node.

  4. On the Logging Settings page, use the following fields to customize logging:

    • Log File — To specify an alternative name or location for the server log file, type the new path name in the text field. By default, the location is domain-dir/logs/server.log.

    • Alarms — To route SEVERE and WARNING messages through the JMX framework, select the Enabled checkbox.

    • Write to System Log — On Solaris and Linux systems only, to send logging output to the syslog facility in addition to the server log, select the Enabled checkbox.

    • Log Handler — To send logs to a destination other than server.log or syslog, you can plug in a custom log handler. The custom handler must extend the class java.util.logging.Handler (a JSR 047 compliant API). Type the absolute class name of the handler in the Log Handler field. Also put the handler class in the Application Server classpath so that the handler is installed during server startup. The log records from the custom handler will have the format described in Log Records.

    • Log Filter — To filter log records that are sent to destinations such as server.log, syslog, or a destination specified by a custom log handler, you can plug in a custom log filter. The custom filter must implement the interface java.util.logging.Filter. Type the absolute class name of the filter in the Log Filter field. Also put the filter class in the Application Server classpath so that the filter is installed during server startup.

    • File Rotation Limit: When the server log reaches the specified size in bytes, the logs are rotated and renamed to server.log_date, where date is the date and time when the file was rotated. The default value is 2 megabytes. The minimum value for the limit is 500 kilobytes; if you specify a lower value, the file rotates when it reaches 500 KB. To turn off log file rotation, set the value to 0.

    • File Rotation Time Limit — Rotate the server log after the specified number of minutes is reached. The default value is zero, which means that the file is rotated when it reaches the size specified in the File Rotation Limit field. If you specify one or more minutes, the time limit takes precedence over the size limit.

  5. Click Save to save changes. Click View Log Files to view the server log.