Before you start
The Log and Trace Analyzer (LTA) in the IBM Autonomic Computing Toolkit monitors, correlates, analyzes, diagnoses, and resolves run-time problems in complex heterogeneous systems. The LTA collects and consolidates practical problem-determination data in the Common Base Event format from disparate systems into a single management tool. You can then use the LTA for viewing, navigating, sorting, filtering, searching, correlating, and analyzing.
My previous tutorial, "Common Base Event Logging" (see Resources), showed how to configure Common Base Event logging in the Java language. This gives you a rich source of activity and control-flow information to accelerate problem determination and increase system serviceability and quality. The LTA can then use logged Common Base Events to detect and resolve configuration errors, performance degradation, exception states, resource starvation, security failures, communication delays, deadlocking, and other problems. However, a common criticism of Common Base Event logging is that it is too heavyweight for simple message logging, causing increased complexity, instrumentation code size, and maintenance. This tutorial shows how to streamline Common Base Event logging to mitigate these issues.
The tutorial:
- Reviews the concept of problem determination and the Common Base Event model. The review details the benefits of and concerns with logging events and problems in the Common Base Event format.
- Teaches best practices that let you streamline Common Base Event logging instrumentation in the Java programming language to reduce complexity and instrumentation code size.
- Shows how to leverage the Common Base Event factory to create a customized XML configuration template for populating Common Base Events with static system-specific content.
- Shows how to extend the Common Base Event factory to create a customized Event Factory Home for retrieving the same static system-specific content set as part of the Java Logging configuration (for example,
java.util.Propertiesconfiguration file) and retrieved from Java Logging's Log Manager. - Shows how to create a customized Content Handler for populating Common Base Events with dynamically resolved run-time content.
- Shows how to merge the Event Factory Home and Content Handler for streamlined Common Base Event logging based on the system's logging configuration file and run time to decrease maintenance and increase customized, vendor-specific content.
Developers can use the best practices and techniques in this tutorial when instrumenting their code for Common Base Event logging, but they are intended primarily for system serviceability architects. Serviceability architects provide a logging strategy for the complete system that individual developers follow when instrumenting Common Base Event logging in their components. System serviceability architects can use these best practices and techniques to craft a logging strategy to ensure consistent and useful problem-determination data to increase system serviceability and quality.
Note that the Common Base Event model is not associated with a particular consumer, such as a logging facility. This tutorial uses the Java Logging APIs because they provide an integrated and extensible logging facility for the Java language useful for illustrative purposes. However, numerous proprietary and open source logging facilities for the Java language are available. The tutorial is not intended to be an exhaustive aid in using this or any other logging facility.
This tutorial is intended for serviceability architects and developers who want to streamline Common Base Event logging in new and existing systems written in the Java language. Basic knowledge of generic logging concepts and Common Base Events, and moderate experience with the Java language and Eclipse, will help you complete the tutorial's tasks and understand its examples.
This tutorial requires the Autonomic Computing Toolkit V3.0.0. The Autonomic Computing Toolkit V3.0.0 requires Eclipse V3.0.3. Eclipse V3.0.3 requires the Java Runtime Environment (JRE) V1.4.x (see Resources).
To run the code and configuration in this tutorial, you need the Common Base Event V1.0.1 Java implementation and support in the Log and Trace Analyzer V3.3.0, which is part of the Autonomic Computing Toolkit V3.0.0. Several plug-in Java Archive (JAR) files located in the <Autonomic Computing Toolkit installation directory>\eclipse\plugins directory are required for this tutorial (see Table 1).
Table 1. Plug-in JAR files required to run the code and configuration in this tutorial
| JAR file | Plug-in |
|---|---|
| hlcbe101.jar | org.eclipse.hyades.logging.core_3.3.0 |
| hlcore.jar | org.eclipse.hyades.logging.core_3.3.0 |
| ecore.jar | org.eclipse.emf.ecore_2.0.2\runtime |
| common.jar | org.eclipse.emf.common_2.0.1\runtime |
| hl14.jar | org.eclipse.hyades.logging.java14_3.3.0 |
| hexr.jar | org.eclipse.hyades.execution.remote_3.3.0 |
See Resources or <Autonomic Computing Toolkit installation directory>\eclipse\plugins\org.eclipse.hyades.logging.core_3.3.0\doc.cbe101\index.html for a link to the Common Base Event V1.0.1 Java implementation API Javadoc documentation.
This tutorial guides you through streamlining Common Base Event logging instrumentation using the Java Logging APIs. The sample code and configuration are provided for reference as an Eclipse Java project. The sample code (com.ibm.tutorial.TutorialClass) provides four distinct scenarios, ranging from standard to fully streamlined Common Base Event logging. These four scenarios illustrate the gradual reduction of complexity and of lines of instrumentation code that you can achieve by using the best practices and techniques you'll learn in this tutorial. To make the project available, follow these steps:
- Save the Tutorial_Java_Project.zip file to a local directory.
- Start the Autonomic Computing Toolkit.
- Open the Java Perspective by selecting Window > Open Perspective > Other... > Java > OK.
- Create a new Java project by selecting File > New > Project... > Java > Java Project > Next.
- Enter a project name, for example
Tutorial. - Select Finish.
- Enter a project name, for example
- Import the Tutorial_Java_Project.zip file into the newly created Java project by selecting the project in the Package Explorer of the Java Perspective and selecting File > Import... > Zip file > Next.
- Select Browse... and navigate to the Tutorial_Java_Project.zip file saved in the local directory in Step 1.
- Select the Tutorial_Java_Project.zip file and select Open.
- Select Finish.
- Select Yes in the question dialog.
Figure 1 illustrates the resultant Java project in the Package Explorer of the Java Perspective.
Figure 1. Java project in the Package Explorer of the Java Perspective


