Collecting an IBM MQ classes for JMS trace by using a Java system property
For issues that can be reproduced in a short amount of time, IBM® MQ classes for JMS trace should be collected by setting a Java system property when starting the application.
About this task
To collect a trace by using a Java system property, complete the following steps.
Procedure
java -Dcom.ibm.msg.client.commonservices.trace.status=ON application_name
- For IBM MQ classes for JMS for IBM MQ 9.0.0 Fix Pack 1 or earlier, trace is written to a file called mqjms_%PID%.trc.
- From IBM MQ 9.0.0 Fix Pack 2, if the application has loaded the IBM MQ classes for JMS from the JAR file com.ibm.mqjms.jar, trace is written to a file called mqjava_%PID%.trc.
- From IBM MQ 9.0.0 Fix Pack 2, if the application has loaded the IBM MQ classes for JMS from the relocatable JAR file com.ibm.mq.allclient.jar, trace is written to a file called mqjavaclient_%PID%.trc.
- From IBM MQ 9.1.5 and IBM MQ 9.1.0 Fix Pack 5, if the application has loaded the IBM MQ classes for JMS from the JAR file com.ibm.mqjms.jar, trace is written to a file called mqjava_%PID%.cl%u.trc.
- From IBM MQ 9.1.5 and IBM MQ 9.1.0 Fix Pack 5, if the application has loaded the IBM MQ classes for JMS from the relocatable JAR file com.ibm.mq.allclient.jar, trace is written to a file called mqjavaclient_%PID%.cl%u.trc.
where %PID% is the process identifier of the application that is being traced, and %u is a unique number to differentiate files between threads running trace under different Java classloaders.
The application stops writing information to the trace file when it is stopped.
If the application has to run for a long period of time before the issue that the trace is being collected for occurs, then the trace file could potentially be very large. In this situation, consider collecting trace by using the IBM MQ classes for JMS configuration file (see Collecting an IBM MQ classes for JMS trace by using the IBM MQ classes for JMS configuration file). When enabling trace in this way, it is possible to control the amount of trace data that the IBM MQ classes for JMS generate.