## Working with the Hyades Apache Commons Logging Sample

Introduction
This sample demonstrates the Hyades support for logging Common Base Events (CBEs) using the Apache Commons logging APIs. Users experience logging CBEs to a Logging Agent. The Logging Agent may be monitored via the Hyades Data Collection Engine application or service and the Hyades workbench.
Contents
The contents of the sample include the Java source code and dependencies necessary to log CBEs to an Apache Commons logger.
Assumptions

1. When either launching this application from the Profiling and Logging Perspective of the workbench or attaching to a Logging Agent using the workbench, the Hyades Data Collection Engine application or service is configured and running.

Dependencies
The JAR files that are listed in the table are required to execute this sample:

JAR file | Plug-in it is contained in
hexr.jar | org.eclipse.hyades.execution.remote
hlcommons.jar | org.eclipse.hyades.logging.commons
commons-logging.jar | org.eclipse.hyades.logging.commons
hlcore.jar | org.eclipse.hyades.logging.core
hlevents.jar | org.eclipse.hyades.logging.core

Execution Steps
To run this sample, follow these steps:

1. Confirm that all compilation errors have been fixed.
2. Enable logging in the Profiling and Logging preferences (Window > Preferences > Profiling and Logging > Enable logging > OK).
3. Add the 'org.eclipse.hyades.logging.commons.sample.HyadesLoggingCommonsSample' logging agent to the Profiling and Logging preferences (Window > Preferences > Profiling and Logging > Logging Agents > New agent > org.eclipse.hyades.logging.commons.sample.HyadesLoggingCommonsSample > Add agent > OK).
4. Start the Hyades Data Collection Engine application or service.
5. Run the sample class (Run > Run As > Java Application).
6. Attach to the 'org.eclipse.hyades.logging.commons.sample.HyadesLoggingCommonsSample' logging agent in the Profiling and Logging Perspective (Profile > Attach > Java Process > org.eclipse.hyades.logging.commons.sample.HyadesLoggingCommonsSample > Next > > Profiling project > Browse... > 'HyadesLoggingCommonsProject' > OK > Finish).
7. Start monitoring the 'org.eclipse.hyades.logging.commons.sample.HyadesLoggingCommonsSample' logging agent (Profile > Start Monitoring).
8. Open the Log View in the Profiling and Logging Perspective to view the logged CBE log records (Window > Show View > Other... > Profiling and Logging > Log View > OK).
9. Refresh Log View in the Profiling and Logging Perspective (Profile > Refresh Views).
10. Alternatively, launch the sample class through the Profiling and Logging Perspective (Profile > Launch > Java Process > Project > Browse... > 'HyadesLoggingCommonsProject' > OK > Main class > Search... > 'HyadesLoggingCommonsProject' > OK > Finish).
11. Open the Log View in the Profiling and Logging Perspective to view the logged CBE log records (Window > Show View > Other... > Profiling and Logging > Log View > OK).
12. Refresh Log View in the Profiling and Logging Perspective (Profile > Refresh Views).