This sample demonstrates the Hyades support for logging Common Base Events using JSR-047 logging APIs implemented in JDK 1.4.0 or above. Users experience logging Common Base Events to the console and a Logging Agent. The Logging Agent may be monitored via the IBM Agent Controller and the workbench.
Contents
The contents of the sample include the Java source code, dependencies and configuration file necessary to log Common Base Events to a JSR-047 logger implemented in JDK 1.4.0 or above (i.e. java.util.logging).
Requirements
JDK 1.4.0 or above (not supplied) is required to compile and execute this sample.
Assumptions
When either launching this application from
the Profiling Perspective of the workbench or attaching to a Logging
Agent using the workbench, the Agent Controller is installed and
running.
When launching
this application from the Profiling Perspective of the workbench, the
Agent Controller is configured during installation to use JDK 1.4.0 or
above.
Dependencies
The following JAR files are required to compile and execute
this sample:
JAR file
Plug-in it is contained in
hexr.jar
org.eclipse.hyades.execution.remote
hl14.jar
org.eclipse.hyades.logging.java14
hlcore.jar
org.eclipse.hyades.logging.core
hlevents.jar
org.eclipse.hyades.logging.core
Execution Steps
To run this sample, follow these steps:
Enable the newly created Java project (i.e. HyadesLoggingJava14Project) to compile and execute using JDK 1.4.0 or above (Project > Properties > Java Build Path > Libraries > JRE_LIB > Remove > Add Library... > JRE System Library > [JDK 1.4.0 or above] > Finish > OK).
Confirm that all compilation errors have been fixed.
Enable logging in the Profiling and Logging preferences (Window > Preferences > Profiling and Logging > Enable logging > OK).
Add the 'org.eclipse.hyades.logging.java.sample.HyadesLoggingJava14Sample' logging agent to the Profiling and Logging preferences (Window > Preferences > Profiling and Logging > Logging Agents > New agent > org.eclipse.hyades.logging.java.sample.HyadesLoggingJava14Sample > Add agent > OK).
Start the IBM Agent Controller service (i.e. Windows) or daemon (i.e. UNIX).
Run the sample class (Run >Run As > Java Application).
Attach to the 'org.eclipse.hyades.logging.java.sample.HyadesLoggingJava14Sample' logging agent in the Profiling Perspective (Profile > Attach > Java Process > org.eclipse.hyades.logging.java.sample.HyadesLoggingJava14Sample > Next > > Profiling project > Browse... > 'HyadesLoggingJava14Project' > OK > Finish).
Start monitoring the 'org.eclipse.hyades.logging.java.sample.HyadesLoggingJava14Sample' logging agent (Profile > Start Monitoring).
Open the Log View in the Profiling Perspective to view the logged Common Base Event log records (Window > Show View > Other... > Profiling and Logging > Log View > OK).
Refresh Log View in the Profiling Perspective (Profile > Refresh Views).
Alternatively, launch the sample class through the Profiling Perspective (Profile > Launch > Java Process > Project > Browse... > 'HyadesLoggingJava14Project' > OK > Main class > Search... > 'HyadesLoggingJava14Sample' > OK > Finish).
Open the Log View in the Profiling Perspective to view the logged Common Base Event log records (Window > Show View > Other... > Profiling and Logging > Log View > OK).
Refresh Log View in the Profiling Perspective (Profile > Refresh Views).