Instrument an application with JRas extensions
We can create an application using JRas extensions.
The JRas framework described in this task and its sub-tasks is deprecated. However, we can achieve similar results using Java logging.
To create an application using the WAS JRas extensions, perform the following steps:
- Determine the mode for the extensions: integrated, stand-alone, or combined.
- If the extensions are used in either stand-alone or combined mode, create the necessary handler and formatter classes.
- If localized messages are used by the application, create a resource bundle.
- In the application code, get a reference to the Manager class and create the manager and logger instances.
- Insert the appropriate message and trace logging statements in the application.
Subtopics
- Create JRas resource bundles and message files
The WebSphere Application Server message logger provides the message and msg methods so the user can log localized messages. In addition, the message logger provides the textMessage method to log messages that are not localized. Applications can use either or both, as appropriate.
- JRas manager and logger instances
We can use the JRas extensions in integrated, stand-alone, or combined mode. Configuration of the application varies depending on the mode of operation, but use of the loggers to log message or trace entries is identical in all modes of operation.
- Set up for integrated JRas operation
Use JRas operations in integrated mode to send trace events and logging messages to only WebSphere Application Server logs.
- Set up for combined JRas operation
Use JRas operation in combined mode to output trace data and logging messages to both WebSphere Application Server and user-defined logs.
- Set up for stand-alone JRas operation
We can configure JRas operations to output trace data and logging messages to only user-defined locations.