Logging with Common Base Event API and the Java logging API

In cases where the events that are generated by the Java logging API are insufficient to describe the event that needs capturing, you can create Common Base Events with the Common Base Event factory APIs.

Before you begin

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 Common Base Events:

About this task

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 approach ensures consistency of Common Base Event content across events. However, you can create and use other Common Base Event factories.

Common Base Events are initiated and logged in the following sequence:
  1. Application code invokes the createCommonBaseEvent method on the EventFactory class to create a CommonBaseEvent.
  2. Application code wraps CommonBaseEvent event in a CommonBaseEventLogRecord record, and adds event-specific data.
  3. Application code calls the CommonBaseEvent event complete method.
  4. The CommonBaseEvent event invokes the ContentHandler completeEvent method.
  5. The ContentHandler handler adds XML template data to the CommonBaseEvent event. Not all ContentHandler handlers support templates.
  6. The ContentHandler handler adds runtime data to the CommonBaseEvent event.
  7. Application code passes the CommonBaseEventLogRecord record to the logger using the Logger.log method.
  8. Logger passes CommonBaseEventLogRecord record to Handlers.
  9. Handlers format data and write to the output device.

Procedure

Results

After completing all the above steps you will have a Common Base event based on your configuration settings.




In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic Task topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Aug 30, 2013 10:47:11 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=pix&product=was-nd-iseries&topic=ttrb_cbeapi
File name: ttrb_cbeapi.html