WebSphere Application Server - Express, Version 6.0.x     Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Using the Common Base Event API with the Java Logging API to log Common Base Events

In cases where the events generated by the Java logging API are insufficient to describe the event that needs to be captured, Common Base Events can be created using the Common Base Event factory APIs. When you create a Common Base Event you can add data to the Common Base Event before it is logged. The following diagram illustrates how application code can create and log CommonBaseEvents:

The steps for generating a Common Base Event are as follows:
  1. Application code invokes createCommonBaseEvent method on EventFactory to create a CommonBaseEvent.
  2. Application code wraps CommonBaseEvent in a CommonBaseEventLogRecord, and adds event specific data.
  3. Application code calls CommonBaseEvent’s complete() method.
  4. CommonBaseEvent invokes ContentHandler’s completeEvent() method.
  5. ContentHandler adds XML template data to CommonBaseEvent (including for example, the component name). Note that not all ContentHandlers support templates.
  6. ContentHandler adds runtime data to CommonBaseEvent (including for example, the current thread name).
  7. Application code passes CommonBaseEventLogRecord to Logger using Logger.log method.
  8. Logger passes CommonBaseEventLogRecord to Handlers.
  9. Handlers format data and write to output device.

WebSphere Application Server is configured to use an event factory that automatically populates WebSphere Application Server specific information into the Common Base Events that it generates. In general it is good practice to create events using the WebSphere Application Server default Common Base Event factory because this ensures consistency of Common Base Event content across events. However, other Common Base Event factories can be create and used. See Configuring Common Base Events for an application for details on how to create and use custom event factories.




Sub-topics
Common Base Event factory context
Common Base Event factory home
Common Base Event factory
Common Base Event content handler

Related reference
Using the Java Logging API to Generate and Log Common Base Events

Reference topic    

Terms of Use | Feedback

Last updated: Jun 8, 2005 12:45:23 PM EDT
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/rtrb_cbeapi.html

© Copyright IBM Corporation 2004, 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)