Tracing and logging configuration
Configure tracing and logging settings to help diagnose problems or evaluate system performance.
You can only enable trace for an application client or standalone process at process startup.
In WAS V6 and later, a logging infrastructure, extending Java Logging, is used. Loggers are equivalent to, and configured in the same way as, trace components introduced in previous versions of WAS. Both are referred to as "components."
Both Java logging levels and WAS levels can be used. The following is a complete list of valid levels, ordered in ascending order of severity:
- all
- finest or debug
- finer or entryExit
- fine or event
- detail
- config
- info
- audit
- warning
- severe or error
- fatal
- off
Setting the logging and tracing level for a component to "all" will enable all the logging for that component. Setting the logging and tracing level for a component to "off" will disable all the logging for that component.
You can only configure a component to one level. However, configuring a component to a certain level enables it to perform logging on the configured level and any higher severity level.
Several levels have equivalent names:
finest equivalent to debug finer equivalent to entryExit fine equivalent to event severe equivalent to error
Trace and logging strings
Tracing for all components is disabled by default. To change the state of tracing and message logging, a logging string must be constructed and passed to the server.
You can type in logging strings, for example...
LOGGINGSTRING=COMPONENT_LOGGING_STRING[:COMPONENT_LOGGING_STRING]* COMPONENT_TRACE_STRING=COMPONENT_NAME=LEVEL LEVEL = all | (finest | debug) | (finer | entryExit) | (fine | event ) | detail | config | info | audit | warning | (severe | error) | fatal | off COMPONENT_NAME = COMPONENT | GROUP...or construct them using the console.
Wildcards
Typically, WAS components register using a fully qualified Java class name, for example...
com.ibm.servlet.engine.ServletEngineUse an asterisk (*) to terminate a component name and indicate multiple classes or packages. For example...
com.ibm.servlet.*Use an asterisk (*) at the end of the component or group name to make the logging string applicable to all components or groups whose names start with specified string. For example, a logging string specifying...
"com.ibm.servlet.*"...as a component name will be applied to all components whose names begin with com.ibm.servlet. When an asterisk (*) is used by itself in place of the component name, the level the string specifies, will be applied to all components.
The following are examples of using an asterisk (*) in logging strings. Note that the asterisk (*) in the logging string does not need to have a period (.) in front of it. The period (.) can be used anywhere in the logging string.
- com.ibm.ejs.ras.*=all
Enable tracing for all loggers with names starting with "com.ibm.ejs.ras.". If there is a logger named "com.ibm.ejs.ras" it will not have trace enabled.
- com.ibm.ejs.ras*=all
Enable tracing for all loggers with names starting with "com.ibm.ejs.ras", such as...
- com.ibm.ejs.ras
- com.ibm.ejs.raslogger
- com.ibm.ejs.ras.ManagerAdmin
In WAS V5.1.1 and earlier, you could set the level to "all=disabled" to disable tracing. This syntax, beginning with Version 6.0, will result in LEVEL=info; tracing will be disabled, but logging will be enabled.
In WAS V6 and later, "info" is the default level. If the specified component is not present (*=xxx is not found), *=info is always implied. Any component that is not matched by the trace string will have its level set to info.
If the logging string does not start with a component logging string specifying a level for all components, using the "*" in place of component name, one will be added, setting the default level for all components.
STATE = enabled | disabled is not needed in V6 and later. However, if used, it has the following effect:
- "enabled" sets the logging for the component specified to the level specified
- "disabled" sets the logging for the component specified to one level above the level specified. The following examples illustrate the effect that disabling has on the logging level:
Logging string Resulting logging level Notes com.ibm.ejs.ras=debug=disabled com.ibm.ejs.ras=finer debug (version 5) = finest (version 6) com.ibm.ejs.ras=all=disabled com.ibm.ejs.ras=info "all=disabled" will disable tracing; logging is still enabled. com.ibm.ejs.ras=fatal=disabled com.ibm.ejs.ras=off com.ibm.ejs.ras=off=disabled com.ibm.ejs.ras=off off is the highest severity
Proceed from broad to specific trace specifications in the trace string
Best practice: Start the trace string from the most broad component groups and then select more specific traces. The advantage to this approach is that the trace settings for classes or packages that are contained in a larger group are specified correctly by including them later in the trace string.bprac
The logging string is processed from left to right. During the processing, part of the logging string might be modified or removed if the levels they configure are overridden by another part of the logging string. Groups that contain packages that disable traces disable any packages that are enabled previously on the same line. For example:
*=off : MyGroup1=info : MyGroup2=finest : com.mycompany.mypackage.*=info : com.mycompany.mypackage.MyClass=finestThis trace string indicates that the only tracing should come from the MyGroup1 group, the MyGroup2 group, and the com.mycompany.mypackage.* package with more specific tracing for MyClass class. If you reverse this string, all tracing is disabled.
Examples
Examples of legal trace strings include:
V5 syntax V6 syntax com.ibm.ejs.ras.ManagerAdmin=debug=enabled com.ibm.ejs.ras.ManagerAdmin=finest com.ibm.ejs.ras.ManagerAdmin=all=enabled,event=disabled com.ibm.ejs.ras.ManagerAdmin=detail com.ibm.ejs.ras.*=all=enabled com.ibm.ejs.ras.*=all com.ibm.ejs.ras.*=all=enabled:com.ibm.ws.ras=debug= enabled,entryexit=enabled com.ibm.ejs.ras.*=all:com.ibm.ws.ras=finer
Related tasks
Enabling trace on client and standalone applications
Enabling trace at server startup
Enabling trace on a running server
Manage the appserver trace service