+

Search Tips   |   Advanced Search

 

Best practices for logging Common Base Events in WebSphere Application Server

 

The following practices ensure consistent use of Common Base Events within your components, and between your components and WebSphere Application Server components. Follow these guidelines:

The following sample Logger.properties file entry demonstrates how to associate the com.ibm.componentX logger with the com.ibm.componentX event factory:

com.ibm.componentX.eventfactory=com.ibm.componentX
The following sample code demonstrates the use of the same event factory setting for direct (Part 1) and indirect (Part 2) Common Base Event logging:

<?xml version="1.0" encoding="UTF-8"?>

<TemplateEvent 
    version="1.0.1" 
    xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
    xsi:noNamespaceSchemaLocation="templateEvent.xsd">

  <CommonBaseEvent 
     <sourceComponentId application="My application" component="com.ibm.componentX"/>
     <extendedDataElements CommonBaseEventname="Sample ExtendedDataElement name"  type="string">
     <values>Sample ExtendedDataElement value</values>
    </extendedDataElements>
  < /CommonBaseEvent>

< /TemplateEvent>




 

Related tasks


Logging with Common Base Event API and the Java logging API
Logging Common Base Events in WAS
Adding logging and tracing to your application

 

Reference topic