Tracing the IBM MQ Console and REST API
The trace facilities in the IBM MQ Console and REST API are provided to help IBM staff to diagnose customer problems. Various properties control the behavior of these facilities.
The IBM MQ Console and REST API consist of three functional areas, each with their own trace mechanisms:
- The IBM MQ Console JavaScript code that executes in the browser.
- The IBM MQ Console and REST API code that runs in the mqweb server.
- The IBM MQ Classes for JMS code that runs in the mqweb server.
Enabling trace for the IBM MQ Console JavaScript code that runs in the browser
This trace is output only from the browser that it is enabled in. After you log out of the IBM MQ Console, trace is automatically disabled.
To enable trace for the IBM MQ Console JavaScript code that runs in the browser:
- Log on to the IBM MQ Console
- Click the dashboard menu icon, and select Diagnostics.
- Select Enable for the IBM MQ Console browser trace, and click OK.
- Follow the steps that are outlined to enable trace for the IBM MQ Console and REST API code running in the mqweb server.
Actions that are performed in your browser then start to be traced. This trace is periodically sent to the IBM MQ Console code that runs in the mqweb server, and is output in the mqweb server trace logs.
Enabling trace for the IBM MQ Console and REST API code that runs in the mqweb server
- Locate the mqwebuser.xml file in one of the following directories:
- MQ_DATA_DIRECTORY/web/installations/installationName/servers/mqweb
- WLP_user_directory/servers/mqweb
Where WLP_user_directory is the directory that was specified when the crtmqweb.sh script ran to create the mqweb server definition.
- Add the following XML to the mqwebuser.xml file, between the server tags:
<variable name="traceSpec" value="*=info:com.ibm.mq*=all:com.ibm.mq.rest*=all:js.mq*=all" />
If the traceSpec variable exists in the mqwebuser.xml file, add the value attributes to the variable. Separate each value attribute with a colon.
If the mqweb server is running, trace is immediately enabled.
Trace is output to a set of files. The active file is called trace.log. Historical trace is kept in files that are called trace_timestamp.log. The size of these trace files, and the number of historical files that are kept can be configured by setting the maxTraceFileSize and maxTraceFiles variables. For more information, see Configure logging.
Enabling trace for the IBM MQ Classes for JMS code that runs in the mqweb server
- Create a file called jmstrace.config in one of the following directories:
- MQ_DATA_DIRECTORY/web/installations/installationName/servers/mqweb
- WLP_user_directory/servers/mqweb
Where WLP_user_directory is the directory that was specified when the crtmqweb.sh script ran to create the mqweb server definition.
- Add the following lines to the jmstrace.config file:
com.ibm.msg.client.commonservices.trace.outputName=PATH/logs/jmstrace.txt com.ibm.msg.client.commonservices.trace.limit=104857600 com.ibm.msg.client.commonservices.trace.count=10 com.ibm.msg.client.commonservices.trace.status=ONWhere PATH specifies the full path to the directory where you want the jmstrace.txt file to be written.
These lines set the maximum trace file size to 100 MB, and set the maximum number of trace files to 10. Ensure that we have disk space available for these files.
- In the same directory as the jmstrace.config file, open or create the jvm.options file.
- Add the following lines to the jvm.options file:
-Dcom.ibm.msg.client.commonservices.trace.startup=TRUE -Dcom.ibm.msg.client.config.location=CONFIG_PATH/jmstrace.configWhere CONFIG_PATH specifies the full path to the directory where the jmstrace.config file is located, as a URL. For example, file:c:/ProgramData/IBM/MQ/web/installations/Installation2/servers/mqweb/.
- Restart the mqweb server by using the endmqweb and strmqweb commands on the command line.
Information to provide to IBM Service
Include the following files and directories when you gather diagnostic information for IBM Service:
- The mqweb.xml file.
- The contents of the directory that contains the mqweb server definition:
- MQ_DATA_DIRECTORY/web/installations/installationName
The directory that was specified when the crtmqweb.sh script ran to create the mqweb server definition. By default, this directory is /var/mqm/web/installation1.