System event logging


The system event logging facility of WebSphere Portal enables the recording of information about the operation of the portal. Event logs provide portal administrators with information on important or abnormal events, especially errors, that occur during the operation of the portal. In addition, event logs gather debugging information that helps portal support to resolve problems with the operation of the portal.

WebSphere Portal provides two types of logging: logging of messages, and logging of debugging messages called traces.

 

Message logging

WebSphere Portal provides the logging of messages that report errors and status information. This type of logging is always enabled.

The following types of messages are provided:

 

Trace logging

WebSphere Portal provides the logging of debugging messages called traces. These traces are useful for fixing problems. However, to save system resources, they are switched off by default.

Traces can be set for different durations:

 

Changing the log file name and location

WebSphere Portal, by default, creates a single log file, wp_root/log/wps_date.log, where date is the date on which the log is created. The date information is automatically inserted in the log file name. This file is updated when an error occurs or if trace logs are created.

You can change the location and the name of this file by changing the configuration key logFileName in the log configuration file (wp_root/shared/app/config/log.properties).

The specified log file name can contain one of two tokens that are automatically replaced with the corresponding values when starting WebSphere Portal:

You can specify the location of the log file either using a relative path or an absolute path.

If you change the location of the log file, restart WebSphere Portal in order to use the new location.

 

Changing the language used in the log file

By default, information in the log file is written in the language that was used for the WebSphere Portal installation. However, because WebSphere Portal supports a number of languages, you can choose to have the log file information written in a language other than that used during installation.

To change the language used for the log file, edit the wp_root/shared/app/config/log.properties file, and add the following line:

locale=xx
where xx is the two-letter abbreviation for the locale. For a list of the locale abbreviations used with WebSphere Portal, refer to the language directory list in Directory structure.

For example, to have log information generated in English, you would add the following line:

locale=en

 

Set temporary traces

To set traces on for the current session only, use the Enable Tracing portlet in Administration.

To set traces, you have to type the desired trace logger strings. You cannot select the trace loggers as described in the portlet help. For a list of trace logger strings refer to Use logs.

 

Set traces for an extended time

To set traces for more than one session, the log configuration key traceString is used. The value is a regular expression-like syntax that specifies one or more Java classes of the WebSphere Portal code for which tracing is enabled.

 

Syntax of the key traceString

The key traceString has the following syntax:

TraceString := <ClassString>(:<ClassString>)*
ClassString := <ClassName>=<type>=<state>(,<type>=<state>)*
ClassName := a java String
state := [enabled|disabled]
type := [all|low|medium|high]

ClassName is used to identify the class (or set of classes) to which the specified change applies. This ClassName may either be an exact name which uniquely identifies a single class, or it may identify a point in the class hierarchy by using the "*" wild card character.

For example, if classes 'a.b.c.d' and 'a.b.c.e' are available, then the name 'a.b.c.d' applies to just one class and the name 'a.b.c.*' applies to both. The following are examples of valid trace strings:

a.b.c.d=all=enabled
a.b.c.d=low=enabled,medium=disabled
a.b.*=low=enabled:a.b.c.d=low=enabled,medium=enabled:a.b.c.e=low=disabled

For traceString values to use for determining problems in portal components, refer to the Information Center topic Using logs.

 

Logging using WebSphere Application Server

WebSphere Portal supports the redirection of its trace and message logging to the logging facility of WebSphere Application Server. This redirection is disabled by default and can be enabled by setting the log configuration key useAppServerLog to true. In this situation, WebSphere Portal no longer creates its own log file, and writes all trace and message logs to the log files of WebSphere Application Server (usually to the files SystemOut.log and trace.log). For more information on configuring these log files, refer to the Information Center of WebSphere Application Server.

 

Reference: Log file format

If the logs are written to the log file of WebSphere Portal and not redirected to the logging facility WebSphere Application Server, the log file consists of a sequence log records that are separated by blank lines.

The log records have the following format:

timestamp classification classname method
messagecode: logmessage

where:

Notes:

  1. Traces are written only if the specific tracing facility is enabled; all other messages are written unconditionally.

  2. The system locale for the portal is part of the general internationalization features of WebSphere Portal and can be configured via LocalizerService. For more information see the Information Center topic Portal configuration.

The following is an example of a log record:

2003.05.16 13:36:14.449 W com.ibm.wps.services.datastore.DataStoreServiceImpl init
DSTO0063W: The transaction isolation level is not set to READ_COMMITTED. 
The current value is TRANSACTION_REPEATABLE_READ.

See also