[UNIX, Linux, Windows, IBM i]

Diagnostic message services

The following diagnostic message services and their service specific attributes, specified under the DiagnosticSystemMessages, DiagnosticMessages and DiagnosticMessagesTemplate stanzas of your configuration files can be defined:

The following diagnostic message services are defined:
File
This service sends any unfiltered messages to a file in a similar way to the QMErrorLog service. Either the existing textual format or the JSON format specified is used depending on the specified Format. By default, there are three files called AMQERR01.LOG, AMQERR02.LOG, and AMQERR03.LOG or AMQERR01.json, AMQERR02.json, and AMQERR03.json, depending upon the Format property, and these rollover based on the configured size.
The following attributes are supported in a File stanza only:
FilePath
The path to where the log files are written. The default is the same location as the AMQERR01.log files, that is system or queue manager. The path must be absolute, but can include replaceable inserts. For example:
+MQ_Q_MGR_DATA_PATH+
The full path to the parent of the queue manager diagnostics messages directory. The default values are:
  • [UNIX]On UNIX and Linux® platforms: /var/mqm/qmgrs/<QM_name>
  • [Windows]on Windows, C:\Program Data\IBM\MQ\qmgrs\<QM_name>
+MQ_DATA_PATH+
The full path to the parent of the system diagnostics messages directory. The default values are:
  • [UNIX]On UNIX and Linux platforms :/var/mqm
  • [Windows]On Windows: C:\Program Data\IBM\MQ
You must create this path with appropriate permissions, if it is not using the existing errors directory.
FilePrefix
The prefix of the log files. The default is AMQERR.
FileSize
The size at which the log rolls over. The default is 32MB, as with the ErrorLogSize property of the QMErrorLog stanza, which is semantically identical.
Note: The ErrorLogSize property only applies to the default error log service, not to custom diagnostic services.

You can set the size of the log using the MQMAXERRORLOGSIZE environment variable.

Format
The format of the file. The value can be either text (for additional QMErrorLog style services) or json, which is the default.
The suffix of the file is either .LOG or .json based on the setting of this attribute.
For example, edit the qm.ini file of the queue manager, and add the following stanza:

DiagnosticMessages:
   Service = File
   Name = JSONLogs
   Format = json
   FilePrefix = AMQERR
After restarting, the queue manager will have AMQERR0x.json files in its ERRORS directory.
You can define multiple File services. This allows configuration as shown in the following examples, where messages of different tags are split over different sets of logs:

DiagnosticMessages:
  Name=ErrorsToFile
  Service=File
  Severities=E+
  FilePrefix=OnlyErrors

DiagnosticMessages:
  Name=NonErrorstoFile
  Service=File
  Severities=1 W
  FilePrefix=Information
[UNIX][Linux]Syslog
The Syslog service is not available on Windows or IBM i
You can define only one Syslog service, and the Syslog service sends any unfiltered messages to syslog using the JSON format diagnostic messages specification. The information is added to syslog in the order shown in the table, starting with the msgID and inserts.
The severity of the message is mapped to the syslog level in the following way:
Table 1. Mapping of message severity to syslog level
Severity Level
0 LOG_INFO
10 LOG_WARNING
20 LOG_ERR
30 LOG_ERR
40 LOG_ALERT
50 LOG_ALERT
The following attribute is supported in a syslog stanza only:
Ident
Defines the ident value associated with the syslog entries. The default value is ibm-mq.
The following example shows error messages being sent to Syslog:

DiagnosticMessages:
  Name=ErrorsToSyslog
  Ident=mq 
  Service=Syslog
  Severities=E+
  

See Diagnostic message service stanzas for more information on generic stanza attributes.

Notes:
  1. For the File service only, you can have multiple stanzas, each with a different name. Only the definition, using the final name in the sequence, takes effect.
  2. Changes to the value of a stanza come into effect only when the queue manager is restarted.