Use Cross Component Trace to troubleshoot applications
Use Cross Component Trace (XCT) to help diagnose problems in WebSphere Application Server.
Depending on the nature of the applications, multiple threads within an application server may be used to handle requests, such as HTTP requests or JMS requests. Some requests may be handled by more than one application server, such as when one application server makes a request to another application server for a web services request. Use XCT to augment log and trace files with correlation information that clarifies which threads and which application server processes participated in the handling of each request.
Tasks
- Enable XCT...
- Log on to the administrative console.
- If using an admin agent topology, select a node to manage and navigate to it.
- Select...
Troubleshooting | Logs and trace | server | Change log detail levels | [Configuration|Runtime] | Enable log and trace correlation
- As appropriate, select...
- Include request IDs in log and trace records
- Create correlation log records
- Capture data snapshots as appropriate
- Click OK.
- If we made our changes on the Configuration tab, save them and restart the application server.
Enabling XCT includes request IDs in log and trace allowing us to see all threads and application server processes related to the same request. Request IDs are only recorded when using HPEL log and trace mode, and can be filtered using the logViewer command.
Enabling XCT to create correlation log records might have a significant performance impact on the system, so is best suited to test and development environments.
XCT can capture data snapshots and store entire message request and response bodies handled by the SIBus to...
$SERVER_LOG_ROOT/snapdata
The application server does not automatically clean up files from this directory. Delete the files from this directory periodically when data snapshot capturing is enabled. Data snapshots store entire request and response contents and may include sensitive information. This option might not be appropriate for use in production environments.
- Use XCT request ID information to track requests.
- Ensure we are using HPEL log and trace mode, since basic mode log and trace does not store request IDs.
- Enable XCT.
- Filter logs to look for important information, such as errors or warnings using the HPEL logViewer command-line tool. Output logs using advanced format so that we can see the request ID information in the logs. For example...
logViewer -minLevel WARNING -format advanced
- When we have found log entries that are of interest to you, note the request ID associated with those entries.
- Filter the logs by request ID using the HPEL logViewer command-line tool and using the request IDs you noted in the previous step, as follows:(Windows)
logViewer -includeExtensions requestID=<requestID>
- Use XCT correlation log records to determine the hierarchy of call chains.
- Enable XCT
Select Include request IDs in log and trace records and correlation log records to ensure that XCT creates correlation log records.
- If we are using HPEL, convert our logs to text using the logViewer command-line tool.
For example, use the command, as follows:
logViewer -outLog myLog.txt
- Use the IBM WebSphere Cross Component Trace logViewer tool available with the IBM Support Assistant to load log and trace files from all application servers involved in handling requests and see the hierarchy of request call chains.
The server is now configured to use XCT.
Subtopics
Change from basic mode to HPEL logging tracing Use IBM Support Assistant logViewer command-line tool