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.
If the property is not set, then no history files cleanup is done.
If the property is set and it's either an invalid number or null, then a default of 10 history files is kept.
If the property is set to 0, then no history files are kept.
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.
In the tree component, expand the Node Agents or Configurations node.
Select a node agent, or select the instance to configure:
For a node agent, select the Logger Settings tab. For a configuration, select the Logger Settings node.
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.
Click Save to save changes. Click View Log Files to view the server log.