Configuring XCT with wsadmin scripting
You can configure Cross-Component Trace (XCT) using wsadmin scripting. Use the examples in this topic as a guide to build your own wsadmin scripts.
About this task
Variable | Description |
---|---|
myCell | The name of the cell |
myNode | The host name of the node |
myServer | The name of the server |
Procedure
- Use the AdminConfig object to configure XCT.
Changes you make using the AdminConfig object take effect the next time you start the server.
- Enable XCT for the server.
By default, XCT is disabled for the server. The following example shows how to enable XCT for the server when your server is using High Performance Extensible Logging (HPEL) log and trace mode. Specify RASLoggingService instead of HighPerformanceExtensibleLogging when your server is using basic log and trace mode. Specify false instead of true to disable XCT.
# get rid of existing property if already present configId = AdminConfig.getid("/Cell:myCell/Node:myNode /Server:myServer/HighPerformanceExtensibleLogging: /Property:com.ibm.websphere.logging.enableCorrelation")if (len(configId) > 0): AdminConfig.remove(configId) # add new property LoggingService = AdminConfig.getid("/Cell:myCell/Node:myNode /Server:myServer/HighPerformanceExtensibleLogging:/") AdminConfig.create("Property", LoggingService, [["name", "com.ibm.websphere.logging.enableCorrelation"],["value", "true"]]) AdminConfig.save()
- Change the log setting for XCT .
By default, the XCT log setting includes request IDs in log and trace files. The following example shows how to make XCT both include request IDs in log and trace files and log XCT log records. Specify REQUEST ID instead of LOG to make XCT only include request IDs in log and trace files. Specify DATA_SNAPSHOT instead of LOG to make XCT include request IDs in log and trace files, log XCT log records, and capture data snapshots. Specify RASLoggingService instead of HighPerformanceExtensibleLogging when your server is using basic log and trace mode.
# get rid of existing property if already present configId = AdminConfig.getid("/Cell:myCell/Node:myNode /Server:myServer/HighPerformanceExtensibleLogging:/Property:com.ibm.websphere .logging.correlationLevel") if (len(configId) > 0): AdminConfig.remove(configId) # add new property LoggingService = AdminConfig.getid("/Cell:myCell/Node:myNode Server:myServer/HighPerformanceExtensibleLogging:/") AdminConfig.create("Property", LoggingService, [["name", "com.ibm.websphere.logging.correlationLevel"],["value", "LOG"]]) AdminConfig.save()
우수 사례: Enable XCT to include request IDs in log and trace files when you want to see which log and trace entries, in all threads and application server processes, are related to the same request. Request IDs are only recorded when using HPEL log and trace mode and can be seen or used for filtering using the logViewer command. bprac
우수 사례: Enable XCT to create correlation log records when you want to log how requests branch between threads and processes, and see extra information about each request. Enabling XCT to create correlation log records might have a significant performance impact on your system, so is best suited to test and development environments.bprac
우수 사례: Enable XCT to capture data snapshots when you want to store entire request and response bodies to the file system. Enabling XCT to capture data snapshots might have a significant performance impact on your system, so is best suited to test and development environments. XCT captures data snapshots for message requests and responses handled by the SIBus.bprac
문제점 방지: Data snapshots are captured and written to the $SERVER_LOG_ROOT/snapdata directory. The application server does not automatically clean up files from this directory. You will need to 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.gotcha
- Enable XCT for the server.
- Use the AdminControl object to configure XCT. Changes
you make using the AdminControl object take effect immediately.
- Enable XCT for the server.
By default, XCT is disabled for the server. The following example shows how to enable XCT for the server when your server is using HPEL log and trace mode. Ensure the server is running and specify RasLoggingService instead of HPELControlService when your server is using basic log and trace mode. Specify false instead of true to disable XCT.
LoggingMBean = AdminControl.queryNames('cell=myCell,node=myNode, type=HPELControlService,process=myServer,*') AdminControl.setAttribute(LoggingMBean, "correlationEnabled", "true")
- Change the log setting for XCT .
By default, the XCT log setting includes request IDs in log and trace files. The following example shows how to make XCT both include request IDs in log and trace files and log XCT log records. Specify REQUEST ID instead of LOG to make XCT only include request IDs in log and trace files. Specify DATA_SNAPSHOT instead of LOG to make XCT include request IDs in log and trace files, log XCT log records, and capture data snapshots. Ensure the server is running and specify RasLoggingService instead of HPELControlService when your server is using basic log and trace mode.
LoggingMBean = AdminControl.queryNames('cell=myCell,node=myNode,type=HPELControlService,process=myServer,*') AdminControl.setAttribute(LoggingMBean, "xctLevel", "LOG")
우수 사례: Enable XCT to include request IDs in log and trace files when you want to see which log and trace entries, in all threads and application server processes, are related to the same request. Request IDs are only recorded when using HPEL log and trace mode and can be seen or used for filtering using the logViewer command. bprac
우수 사례: Enable XCT to create correlation log records when you want to log how requests branch between threads and processes, and see extra information about each request. Enabling XCT to create correlation log records might have a significant performance impact on your system, so is best suited to test and development environments.bprac
우수 사례: Enable XCT to capture data snapshots when you want to store entire request and response bodies to the file system. Enabling XCT to capture data snapshots might have a significant performance impact on your system, so is best suited to test and development environments. XCT captures data snapshots for message requests and responses handled by the SIBus.bprac
문제점 방지: Data snapshots are captured and written to the $SERVER_LOG_ROOT/snapdata directory. The application server does not automatically clean up files from this directory. You will need to 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.gotcha
- Enable XCT for the server.
Results


http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=ttrb_confXTCwsadmin
파일 이름:ttrb_confXTCwsadmin.html