In the navigation tree, expand the Configurations node.
Under the Configurations node, click the server instance or cluster configuration for which you want to configure Logger Settings.
The Configuration page opens.
On the Configuration page, click Logger Settings.
The Logger Settings page for the selected configuration target opens.
Select the Write to System Log Enabled checkbox to send logging output to the syslog
facility in addition to the server log.
This feature is available on Solaris and Linux systems only. This option is disabled by default.
Select the Log to Console Enabled checkbox to send logging output to the system console.
This option is disabled by default.
Select the Rotation on Date Change Enabled checkbox to rotate server log files every day at midnight.
This option is disabled by default.
Select the Multiline Mode Enabled checkbox to start the body of a log message on a new line after the log message header.
This option is enabled by default.
From the Console Logging Format drop-down list, select the format to use to log to the console.
Available formats are ULF (UniformLogFormatter) or ODL (Oracle Diagnostics Logging). The default format is ULF.
From the Log File Logging Format drop-down list, select the format to use to log to the server log file.
Available formats are ULF or ODL. The default format is ODL.
In the Format Exclude Fields field, specify the fields to exclude in the log record.
All fields are included by default.
In the File Rotation Limit field, type the size in bytes that the server log file must reach before it is rotated.
When the server log reaches the specified size, GlassFish Server creates a new, empty file named server.log
and renames the old file 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.
In the File Rotation Time Limit field, type the number of minutes after which the server log must be rotated.
The default value is 0, which means that the file is rotated when it reaches the size specified in the File Rotation Limit field.
Note:
If you specify one or more minutes, the time limit takes precedence over the size limit specified by the File Rotation Limit field.
In the Flush Frequency field, type the maximum number of messages to be written from the queue to the server log at a time.
The default value is 1.
In the Maximum History Files field, type the maximum number of log files that GlassFish Server should keep before deleting the oldest file. If you set this value to zero (0), GlassFish Server does not delete any old log files.
In the Log File field, type an alternative name or location for the server log file.
The default location is ${com.sun.aas.instanceRoot}/logs/server.log
.
In the Log Handler field, type the absolute class name of a custom log handler.
A custom log handler enables you to send logs to a destination other than server.log
or syslog
. The custom handler must extend the class java.util.logging.ConsoleHandler
(a JSR 047 compliant API). Put the handler class in the GlassFish Server classpath so that the handler is installed during server startup.
Click Save.
Note:
Depending on the configuration for which logging was enabled, a server restart may be required.
A server restart may also be required if the name of the log file is changed from the default setting. A Restart required
message will be displayed in the upper right corner of the Administration Console if it is necessary to restart the server.