Add logging and tracing to the application
We can add logging and tracing to applications to help analyze performance and diagnose problems in WAS.
Deprecation: The JRas framework that is described in this information center is deprecated. However, we can achieve the same results using Java logging.
Designers and developers of applications that run with or under WAS, such as servlets, JSPs, enterprise beans, client applications, and their supporting classes, might find it useful to use Java logging for generating their application logging. This approach has advantages over adding System.out.println statements to the code:
- Your messages are displayed in the WAS standard log files, using a standard message format with additional data, such as a date and time stamp that are added automatically.
- We can more correlate problems and events in our own application to problems and events that are associated with WAS components.
- We can take advantage of the WAS log file management features.
- We can view the messages with the Log and Trace Analyzer tool.
- Enable and configure one of the supported types of logging.
Use one of the following methods:
- Customize the properties to meet the logging needs. For example, enable or disable a particular log, specify the number of logs to be kept, and specify a format for log output.
- Restart the appserver after making static configuration changes.
Set Java logging
Set applications to use Jakarta Commons Logging
Programming with the JRas framework
Logging Common Base Events in WAS
Related tasks
Use a logger