MQe does not automatically capture the trace information provided by the MQeTrace.trace() methods. The solution programmer must capture the trace messages. We strongly recommend that your solution includes a mechanism to allow the capture of MQe trace events, as this output may be requested by the IBM® service teams when investigating any problems reported.
// Allocate a trace instance, so that our handler // is not garbage collected when it's on. myMQeTrace = new MQeTrace(); // Allocate a trace handler // This one puts trace output to stdout by default. MQeTraceHandler handler = (MQeTraceHandler) new com.ibm.mqe.trace.MQeTraceToReadable(); // Set this handler as the one MQe uses. MQeTrace.setHandler(handler); // Set the filter so we collect those // pieces of trace we are interrested in. // In this case, collect all the default trace information. MQeTrace.setFilter(MQeTrace.GROUP_MASK_DEFAULT); ... // To end trace set the filter to zero and the handler to null MQeTrace.setFilter(0); MQeTrace.setHandler(null);This example shows the creation of a trace handler, MQeTraceToReadable in this case, and setting of the filter to capture the default trace information. This can result in lots of information being captured. You can use a more restrictive filter to capture only a subset of the data. For example, collecting errors, warnings, and user-coded trace points might be more appropriate:
MQeTrace.GROUP_ERROR | MQeTrace.GROUP_WARNING | MQeTrace.GROUP_MASK_USER_DEFINED