In the WebSphere Application Server, the Java logging API (java.util.logging)
automatically creates Common Base Events for events logged at level WsLevel.DETAIL
or above (including WsLevel.DETAIL, Level.CONFIG, Level.INFO, WsLevel.AUDIT,
Level.WARNING, Level.SEVERE, and WsLevel.FATAL). These Common Base Events
are created using the event factory associated with the Logger to which the
message was logged. If no event factory is specified, WebSphere Application
Server uses a default event factory which will automatically fill in WebSphere
Application Server specific information.
The java.util.logging.Logger
class provides a variety of methods with which data can be logged. The WebSphere
Application Server uses a special implementation of the Logger class that
automatically creates Common Base Events for the following methods:
- config
- info
- warning
- severe
- log - all variants except log(LogRecord) when used with WsLevel.DETAIL
or more severe levels
- logp - when used with WsLevel.DETAIL or more severe levels
- logrb - when used with WsLevel.DETAIL or more severe levels
WebSphere Application Server logger implementation is only used for named
loggers (for example, loggers instantiated with calls such as Logger.getLogger("com.xyz.SomeLoggerName")).
Loggers instantiated with calls to Logger.getAnonymousLogger() and Logger.getLogger(""),
or Logger.global do not use the WebSphere Application Server implementation,
and do not automatically create Common Base Events for logging requests made
to them. LogRecords logged directly with Logger.log(LogRecord) are not automatically
converted by WebSphere Application Server’s Loggers into Common Base Events.
The following diagram illustrates how application code can create
log CommonBaseEvents:

The Java logging API processing of named Loggers and message
level events proceeds as follows:
- Application code invokes named Logger (WsLevel.DETAIL or above) with event
specific data.
- Logger creates a CommonBaseEvent using createCommonBaseEvent method on
EventFactory associated to the Logger (see Configuring Common Base Events
for an application).
- Logger creates a CommonBaseEvent using EventFactory associated to the
Logger
- Logger wraps CommonBaseEvent in a CommonBaseEventLogRecord, and adds event
specific data.
- Logger calls CommonBaseEvent’s complete() method.
- CommonBaseEvent invokes ContentHandler’s completeEvent() method.
- ContentHandler adds XML template data to CommonBaseEvent (including for
example, the component name). Note that not all ContentHandlers support templates.
- ContentHandler adds runtime data to CommonBaseEvent (including for example,
the current thread name).
- Logger passes CommonBaseEventLogRecord to Handlers.
- Handlers format data and write to Output Device.