Notification Logging Service

Since version 4.1.2.181

Payara Notification Logging Service captures information about events which come from other services, such as the JMX Monitoring Service, the HealthCheck service or the Request Tracing service and stores it into a log file.

All the generated logs are stored in server.log by default. But, since Payara Server 4.1.1.163 it is possible to configure the Log Notifier to output to a separate log file. More information on Log Notifier can be found on the the Log Notifier.

If Log Notifier is configured to use a separate log file, the default log file can be found at:

Log File Name and Location

domain-dir/logs/notification.log

Payara Notification Logging Service uses its own collection of logging properties that is stored in a configuration file. By default logging properties file can be found at:

Logging Properties File Name and Location

domain-dir/config/logging.properties

Configuring the Payara Notification Logging Service

This section will go through following topics:

Payara Server most be restarted after changes are made to logging options for it to apply.

Enabling or Disabling Logging to a File

Log to File option will provide a way to enable and disable logging to a file of Payara Server Notifications. When disabled this should help to minimize disk usage. This option will be more accommodating if Payara Server is running in cloud environment where disk space is scarce.

Using the Admin Console

To configure Log to File option using Admin Console:

Log to File enabled

Using an asadmin command

Use the following command to enable or disabled logging to a file:

asadmin> set-log-attributes fish.payara.enterprise.server.logging.PayaraNotificationFileHandler.logtoFile=false

Configuring Log File Rotation

By default log rotation is set to rotate when the log file reaches 2 Megabytes(MB). Nonetheless, there are number of ways log rotation can be configured. Size of file at which the log rotates can be changed, it can be set to rotate at date change, rotate when time limit is reached and, finally based on maximum number of history files. Further details about these options will be explained in the following section:

Rotation on Date Change

Rotation On Date Change option provides a way to set log rotation at date change (at midnight).

Using the Admin Console

To configure Rotation on Date Change option using Admin Console:

Rotation on Date Change enabled

Using an asadmin command

Use the following command to enable or disabled rotation of log on date change:

asadmin> set-log-attributes fish.payara.enterprise.server.logging.PayaraNotificationFileHandler.rotationOnDateChange=false

Rotation on File Size

File Rotation Limit option provides a way to change the file size at which the Payara Server Community rotates the log file. This option accepts an integer value specifying the maximum size of the log file, after which a file rotation will occur. The minimum size it can be set to is 500000 Bytes. If the value for this option is set to 0 rotation is disabled.

Using the Admin Console

To configure File Rotation Limit option using Admin Console:

File Rotation Limit

Using an asadmin command

Use the following command to change rotation of log on file size:

asadmin> set-log-attributes fish.payara.enterprise.server.logging.PayaraNotificationFileHandler.rotationLimitInBytes=500000

Rotation on Time Limit

File Roatation Time Limit option provides a way to change the log file rotation time limit interval.

Using the Admin Console

To configure File Roatation Time Limit option using Admin Console:

File Roatation Time Limit

Using an asadmin command

Use the following command to change rotation of log on time limit interval:

asadmin> set-log-attributes fish.payara.enterprise.server.logging.PayaraNotificationFileHandler.rotationTimelimitInMinutes=4

To Change Logging Format

Since version 5.183

Log File Logging Format option will provide a way to change logging format. There are 3 logging formats available: ULF, ODL and JSON.

Using the Admin Console

To configure Log File Logging Format option using Admin Console:

Change Logging Format

Using an asadmin command

Use the following command to change logging format:

asadmin> set-log-attributes fish.payara.enterprise.server.logging.PayaraNotificationFileHandler.formatter=fish.payara.enterprise.server.logging.JSONLogFormatter

To Set Maximum Number of History Files

Maximum History Files option provides a way to set the limit on the number of log files that can be created by Payara Server. Once the number of files reaches the set limit, oldest rotated log file is deleted. If the value for this option is set 0, all the rotated log files are preserved.

Using the Admin Console

To configure Maximum History File option using Admin Console:

Maximum History File

Using an asadmin command

Use the following command to set the limit on the number of log files that can be created by Payara Server:

asadmin> set-log-attributes fish.payara.enterprise.server.logging.PayaraNotificationFileHandler.maxHistoryFiles=20

To change the Name and Location of the Log File

Log File option provides a way to change the name and location of the log files.

Using the Admin Console

To configure Log File option using Admin Console:

Log File

Using an asadmin command

Use the following command to change the name and location of the log file:

asadmin> set-log-attributes fish.payara.enterprise.server.logging.PayaraNotificationFileHandler.file=${com.sun.aas.instanceRoot}/notification/testNotification.log

To Set Compress on Rotation

Compress on Rotation provides a way to set compression of log files on rotation automatically.

Using the Admin Console

To configure Compress on Rotation option using Admin Console:

Compress on Rotation enabled

Using an asadmin command

Use the following command to enable or disable compression of log files on rotation:

asadmin> set-log-attributes fish.payara.enterprise.server.logging.PayaraNotificationFileHandler.compressOnRotation=true