Diagnostic message logging

The diagnostic message logs of IBM® MQ are a mechanism, to allow various components of the IBM MQ system, to report diagnostic messages relating to IBM MQ configuration and runtime state changes and issues.

These logs are sometimes referred to as IBM MQ error logs, but have always contained IBM MQ information and warning messages, as well as error messages. The three primary components of IBM MQ which report to these logs are:
  • Queue Managers
  • IBM MQ Clients
  • The remainder of the IBM MQ system
IBM MQ supports reporting diagnostics messages through a number of different methods known as diagnostics message services, allowing for a tailored approach to recording and consuming this information:
  • AMQERRnn log files
  • JSON formatted log files
  • [UNIX]Syslog in JSON format

JSON output by IBM MQ is formatted as single line JSON objects, such that each individual line of the JSON log, or Syslog record, represents a valid JSON object. The log as a whole is not encapsulated as a single JSON object.

The following illustration shows that queue managers, IBM MQ clients, and the IBM MQ system can all report diagnostic messages using the methods described.

Figure 1. How different parts of IBM MQ can report diagnostic messages
The diagram shows how different parts of the IBM MQ system can report diagnostic messages.

How IBM MQ diagnostics logs are configured:

Diagnostic logs are defined and customized using stanzas within the qm.ini file particular to the IBM MQ component that requires them. Each unique logging end point is defined under its own stanza heading within the ini file, along with any customizations defined within it. Customizations can include:
  • The size of log files to wrap on, before rollover will occur; not applicable to Syslog
  • Any filtering based on the severity of the log messages, and
  • Any specific message codes to suppress.
IBM MQ can be configured to write to any, or all, of the three types of logging end points, allowing for particular log stanzas to fulfill particular roles. Similarly, multiple file services can be defined. For example:
  • JSON format makes for easier parsing through automated tooling in local and Cloud environments.
  • Syslog output allows IBM MQ components to integrate diagnostics information into a common OS logging location in line with other products on the system.
  • Log end points filtered based on severity allowing for particular log files to record, for example, only severe errors in the system.

Regardless of the style of diagnostics logging configured, the traditional diagnostics files held under the IBM MQ system log directory (/var/mqm/errors/AMQERRnn.log) and specific queue manager log directory (/var/mqm/qmgrs/<qmgr_name>/errors/AMQERRnn.log) are always written to, in addition to any other logging configuration used.

For queue managers only, optional configuration of these mandatory logs can be performed by specifying attributes of the Diagnostic message service stanzas.

Different stanza areas

The additional stanzas can be applied to different areas of IBM MQ.
Qmgr(qm.ini)
Applies to log message generated by the queue manager
System(mqs.ini)
Applies to log messages generated by the system. This option is not specific to a queue manager, except when a queue manager cannot access or write to its own logs.
Templates(mqs.ini)
One or more stanzas as templates, which are copied to qm.ini when a queue manager is created.
Client(mqclient.ini)
Applies to client operation, for example runmqsc in client mode to a remote queue manager.

Converting between JSON formatted and traditionally formatted logs

The mqrc command has been enhanced to allow a number of conversions between JSON and traditionally formatted logs, and between different languages.