Diagnostic message services
The following diagnostic message services and their service specific attributes,
specified under the DiagnosticSystemMessages, DiagnosticMessages and DiagnosticMessagesTemplate
stanzas of our 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
FilePrefix 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:
- On UNIX platforms:
/var/mqm/qmgrs/<QM_name>
- 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:
- On UNIX platforms
:/var/mqm
- On Windows: C:\Program
Data\IBM\MQ
- We 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 on UNIX, Linux, and Windows, which is semantically identical.
We can set the size of the log
using the MQMAXERRORLOGSIZE attribute in the mq.ini file.
- 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.
- We 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
- Syslog
- The Syslog service is not available on Windows or
IBM i
- We 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:
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:
- For the File service only, we can have multiple stanzas, each with a different name. Only the
definition, using the final name in the sequence, takes effect.
- Changes to the value of a stanza come into effect only when the queue manager is restarted.
Parent topic: Diagnostic message service stanzas