[MQ 9.3.3 Jun 2023]

Tracing IBM MQ .NET applications with mqclient.ini

From IBM® MQ 9.3.3, you can use the mqclient.ini file to enable traces for the IBM MQ .NET client libraries.

About this task

From IBM MQ 9.3.3, the mqclient.ini file includes a Trace stanza. To enable trace, you must set the appropriate properties of the Trace stanza. If a property is set to an invalid value, then the properties are ignored.

You can also enable and disable tracing dynamically. When the application is running, if the mqclient.ini file is modified, created, or deleted, the IBM MQ .NET client reads the properties of the trace section again and then enables or disables the trace, so that restart of the application is not needed.

Note: There are several different ways to enable trace.
For the IBM MQ .NETclient libraries built against .NET Framework, the order of precedence is as follows:
  1. App.Config
  2. Environment variable
  3. mqclient.ini
For the IBM MQ .NET client libraries built against .NET Standard and .NET 6, the order of precedence is as follows:
  1. Environment variable
  2. mqclient.ini

Procedure

  • To start trace, specify the following attributes of the Trace stanza:
    1. Set MQDotnetTraceLevel to the value corresponding to the level of tracing you want.
      If you want to start tracing with full details (recommended), set this attribute to 2. If you want a less detailed trace, set the attribute to 1.
    2. Set MQDotnetTracePath to the file path of the folder where you want the trace files to be created.
      The current directory of the application is used if the path is left blank or if the MQDotnetTracePath attribute is not defined.
    3. Set MQDotnetErrorPath to the file path of the folder where you want the error log files to be created.
      The current directory of the application is used if the path is left blank or if the MQDonetErrorPath attribute is not defined.
  • To stop trace, set MQDotnetTraceLevel to 0.
    This is the default value for this attribute.