The Generic Log Adapter provides an outputter class that allows the Common Base Event objects generated by your adapter to be sent to a logging agent. The Log and Trace Analyzer can be used to attach to the logging agent, to monitor and to analyze the application log in real time.
Prerequisites:Please follow these steps to configure your adapter for monitoring.
Note: When a new adapter configuration file is created, it is configured to use the
CBELogOutputter class by default. If you have not changed this setting,
you can skip this procedure.
The outputter component in the adapter configuration file needs to be updated
to use the CBELogOutputter class which writes the Common Base Event objects
to a logging agent. You can either update the existing Outputter Component
or add a new Outputter component.
To add a new outputter component:
| Name: | Outputter name in the context |
| Description: | Description of what this outputter does |
| Executable class: | org.eclipse.hyades.logging.adapter.outputters.CBELogOutputter |
| Logging level: | The level of internal logging the outputter component should use.
A value of 99 means the outputter will not log any messages. A value of 0 means the outputter will log messages of all severities. The recommended value is 50 which means that only Critical or Fatal internal outputter errors messages are logged. |
| Role: | Outputter |
| UniqueID: | Must point to the outputter defined in the Context Instance in step 2. Use the Browse button to select the correct ID. |
If you want the log parser to be monitor the log file continuously, you need to update the context instance properties of the adapter configuration file for continuous operation.
The log adapter you created can be run externally
from a batch file in the Windows environment or a shell script
in non-Windows environments. Below are sample files that can
be used to launch the Java process that will run your log adapter.
Note: To run the Generic Log Adapter on a system, Hyades must be installed on that system.
Windows batch file:
@rem USAGE: runregex @rem Change the following lines to point to the directory where you unzipped the runtime @rem and the directory where your log adapter resides SET HYADES_HOME=d:\hyadesDC SET YOUR_ADAPTER_DIRECTORY=MyAdapterDirectory SET CONFIG_FILE=%HYADES_HOME%\%YOUR_ADAPTER_DIRECTORY%\myadapter.adapter PUSHD %HYADES_HOME%\%YOUR_ADAPTER_DIRECTORY% java -classpath "%HYADES_HOME%\lib\glaconfigs.jar;%HYADES_HOME%\lib\hexr.jar;%HYADES_HOME%\lib\hgla.jar;%HYADES_HOME%\lib\hglaconfig.jar;%HYADES_HOME%\lib\hlcore.jar;%HYADES_HOME%\lib\hlevents.jar;%HYADES_HOME%\lib\hparse.jar;;%HYADES_HOME%\lib\logparsers.jar;%HYADES_HOME%\lib\xalan.jar;" org.eclipse.hyades.logging.adapter.Adapter -ac "%CONFIG_FILE%" -cc "%CONFIG_FILE%" POPDnon-Windows batch file:
#!/bin/sh # USAGE: runregex_example.sh # Change the following line to point to the directory where you unzipped the runtime HYADES_HOME=/home/hyadesDC export HYADES_HOME YOUR_DIRECTORY=/yourdirectory export YOUR_DIRECTORY CONFIG_FILE=$HYADES_HOME/$YOUR_DIRECTORY/myadapter.adapter export CONFIG_FILE CUR_DIR=`pwd` export CUR_DIR cd $HYADES_HOME/$YOUR_DIRECTORY java -classpath "$HYADES_HOME\lib\glaconfigs.jar;$HYADES_HOME\lib\hexr.jar;$HYADES_HOME\lib\hgla.jar;$HYADES_HOME\lib\hglaconfig.jar;$HYADES_HOME\lib\hlcore.jar;$HYADES_HOME\lib\hlevents.jar;$HYADES_HOME\lib\hparse.jar;;$HYADES_HOME\lib\logparsers.jar;$HYADES_HOME\lib\xalan.jar;" org.eclipse.hyades.logging.adapter.Adapter -ac "$CONFIG_FILE" -cc "$CONFIG_FILE" cd $CUR_DIRConfigure the file as required to launch the Java process that will run your adapter.
You are now ready to monitor the live application log.

Related Concepts
Overview of the Hyades Generic Log Adapter
Common Base Event format specification
Related tasks
Creating a log parser
Related references
Adapter Configuration File structure
Adapter Configuration Editor
Regular expression grammar