JVM log settings

 

+

Search Tips   |   Advanced Search

 

Use this page to view and modify the settings for the Java virtual machine (JVM) System.out and System.err logs.

To view this console page, click...

Troubleshooting | Logs and Trace | server name | JVM Logs

View and modify the settings for the Java Virtual Machine (JVM) System.out and System.err logs for this managed process. The JVM logs are created by redirecting the System.out and System.err streams of the JVM to independent log files. The System.out log is used to monitor the health of the running appserver. The System.err log contains exception stack trace information that is useful when performing problem analysis. There is one set of JVM logs for each appserver and all of its applications. JVM logs are also created for the deployment manager and each node manager. Changes on the Configuration panel will apply when the server is restarted. Changes on the Runtime panel will apply immediately.

 

Configuration tab

File Name

Name of one of the log file described on this page.

The first file name field specifies the name of the System.out log. The second file name field specifies the name of the System.err file.

Press the View button on the Runtime tab to view the contents of a selected log file. The file name specified for the System.out log or the System.err log must have one of the following values:

filename

The name of a file in the file system. IBM recommends that you use a fully qualified file name. If the file name is not fully qualified, it is considered to be relative to the current working directory for the server. Each stream must be configured with a dedicated file. For example, you cannot redirect both System.out and System.err to the same physical file.

If the directory containing the file already exists, the user ID under which the server is running requires read/write access to the directory. If the directory does not exist, it will be created with the proper permissions. The user id under which the server is running must have authority to create the directory.

console

This is a special file name used to redirect the stream to the corresponding process stream. If this value is specified for System.out, the file is redirected to stdout. If this value is specified for System.err, the file is redirected to stderr.

none

Discards all data written to the stream. Specifying none is equivalent to redirecting the stream to dev/null on an operating system such as AIX of Linux.

The default path for filename is the value of the variable SERVER_LOG_ROOT. To see the value of the SERVER_LOG_ROOT variable:

  1. On the console, select...

    Environment | WebSphere Variables

  2. Click on the Server radio button, and then click Apply. The value of the SERVER_LOG_ROOT variable appears in the resulting list.

To change the value of SERVER_LOG_ROOT:

  1. Select SERVER_LOG_ROOT

  2. Enter a new path in the Value field

  3. Click Apply

  4. Save the configuration. You will have to restart the server for the change to take effect.

You can also change the location and name of the ${SERVER_LOG_ROOT}/SystemOut.log and ${SERVER_LOG_ROOT}/SystemErr.log files to any other absolute path and filename (for example, /tmp/myLogfile.log).

File formatting

Format to use in saving the System.out file.

Log file rotation

Use this set of configuration attributes to configure the System.out or System.err log file to be self-managing.

A self-managing log file writes messages to a file until reaching either the time or size criterion. At the specified time or when the file reaches the specified size, logging temporarily suspends while the log file rolls over, which involves closing and renaming the saved file. The new saved file name is based on the original name of the file plus a timestamp qualifier that indicates when the renaming occurs. Once the renaming completes, a new, empty log file with the original name reopens and logging resumes. All messages remain after the log file rollover, although a single message can split across the saved and the current file. You can only configure a log to be self-managing if the corresponding stream is redirected to a file.

File Size

Click this attribute for the log file to manage itself based on its file size. Automatic roll over occurs when the file reaches the specified size you specify in the maximum size field.

Maximum Size

Maximum size of the file in megabytes. When the file reaches this size, it rolls over.

This attribute is only valid if you click File size.

Time

Click this attribute for the log file to manage itself based on the time of day. At the time specified in the start time field, the file rolls over.

Start Time

Specify the hour of the day, from 1 to 24, when the periodic rollover algorithm starts for the first time after an Application Server restart. The algorithm loads at Application Server startup. Once started at the (start time field) hour, the rollover algorithm rolls the file every (repeat time field) hours. This rollover pattern continues without adjustment until the Application Server stops.

The rollover always occurs at the beginning of the specified hour of the day. The first hour of the day, which starts at 00:00:00 (midnight), is hour 1 and the last hour of the day, which starts at 23:00:00, is hour 24. Therefore, if you want log files to roll over at midnight, set the start time to 1.

Repeat time

Specifies the number of hours after which the log file rolls over. Valid values range from 1 to 24.

Configure a log file to roll over by time, by size, or by time and size. Click File Size and Time to roll the file at the first matching criterion. For example, if the repeat time field is 5 hours and the maximum file size is 2 MB, the file rolls every 5 hours, unless it reaches 2 MB before the interval elapses. After the size rollover, the file continues to roll at each interval.

Maximum Number of Historical Log Files

Number of historical (rolled) files to keep. The stream writes to the current file until it rolls. At rollover, the current file closes and is saved as a new name consisting of the current name plus the rollover timestamp. The stream then reopens a new file with the original name to continue writing. The number of historical files grows from zero to the value of the maximum number of historical files field. The next rollover deletes the oldest historical file.

Installed Application Output

Specifies whether System.out or System.err print statements issued from application code are logged and formatted.

Show application print statements

Click this field to show messages that applications write to the stream using print and println stream methods. WebSphere Application Server system messages always appear.

Format print statements

Click this field to format application print statement like WebSphere Application Server system messages.

 

Runtime tab

File Name

Name of one of the log file described on this page.

The first file name field specifies the name of the System.out log. The second file name field specifies the name of the System.err file.

Press the View button on the Runtime tab to view the contents of a selected log file. The file name specified for the System.out log or the System.err log must have one of the following values:

filename

The name of a file in the file system. IBM recommends that you use a fully qualified file name. If the file name is not fully qualified, it is considered to be relative to the current working directory for the server. Each stream must be configured with a dedicated file. For example, you cannot redirect both System.out and System.err to the same physical file.

If the directory containing the file already exists, the user ID under which the server is running requires read/write access to the directory. If the directory does not exist, it will be created with the proper permissions. The user id under which the server is running must have authority to create the directory.

console

This is a special file name used to redirect the stream to the corresponding process stream. If this value is specified for System.out, the file is redirected to stdout. If this value is specified for System.err, the file is redirected to stderr.

none

Discards all data written to the stream. Specifying none is equivalent to redirecting the stream to dev/null on an operating system such as AIX of Linux.
The default path for filename is the value of the variable SERVER_LOG_ROOT. To see the value of the SERVER_LOG_ROOT variable:

  1. On the console, select Environment > WebSphere Variables

  2. Click on the Server radio button, and then click Apply. The value of the SERVER_LOG_ROOT variable appears in the resulting list.

To change the value of SERVER_LOG_ROOT:

  1. Select SERVER_LOG_ROOT

  2. Enter a new path in the Value field

  3. Click Apply

  4. Save the configuration. You will have to restart the server for the change to take effect.

You can also change the location and name of the ${SERVER_LOG_ROOT}/SystemOut.log and ${SERVER_LOG_ROOT}/SystemErr.log files to any other absolute path and filename (for example, /tmp/myLogfile.log).




 

Related tasks


Configure the JVM logs
Diagnosing problems with message logs

 

Reference topic