The MQ continuous development release 9.0.5 has a number of new error message logging facilities.

* generating one or more error log files similar to the existing MQ error files either in the text format or in JSON format.
* filter the error message appended to these files by severity and/or error code.
* appending error message to a system syslog facility.

Here are same examples

Record only Error and Severe messages

Append the following stanza to a queue managers qm.ini file, ensure directory /home/newlog/qmgr/qm1 is writeable by mqm and restart that queue manager.

DiagnosticMessages:
    Service=File
    Name=MyQM1
    Format=text
    FilePath=/home/newlog/qmgr/qm1
    Severities=E,S

Whenever MQ generates any error log messages of either severity error or severe it will append it to AMQERR001.LOG in directory /home/newlog/qmgr/qm1.

Record all messages in JSON format

Add the following stanza to a queue manager qm.ini file, ensure the directory is accessible and restart the queue manager

DiagnosticMessages:
    Service=File
    Name=MyQM2
    Format=json
    FilePath=/home/newlog/qmgr/qm2
    FilePrefix=QM

Whenever MQ generates any error log messages, they will be append it to QM01.json in directory /home/newlog/qmgr/qm2.

Record all messages to the o/s system log facility

Add the following stanza to a queue manager qm.ini file, ensure the directory is accessible and restart the queue manager

DiagnosticMessages:
    Service=Syslog
    Name=MySyslog
    Ident=SysLogName

Whenever MQ generates any error log messages they are passed to the System Log daemon for logging in the o/s system log.

What do the entries mean?

Name unique name for this error log definition.
Service File : sends error messages to a file
Syslog : sends error messages to the o/s system log.
Format text : same format as MQ error log
json : JavaScript Object Notation, machine readable format
FilePath file path of the directory to write the error log files.
Default is MQ_DATA/<qmgr>/errors
FilePrefix prefix for each error message log.
Default is AMQERR
Ident identity used when sending the error messages to o/s System log.

Other configurations

System error messages

Similar stanza can be applied to system error message (non queue manager specific) to the stanza reference is changed to DiagnosticSystemMessages and added to the mqs.ini file.

Client error messages

For capturing error message on a client only machine, change the stanza reference to DiagnosticSystemMessages and apply the same stanza to mqclient.ini.

Template – using predefined stanzas

Template stanzas can be added to mqs.ini using the DiagnosticMessagesTemplate stanza reference, so that when a new queue manager is created they are automatically applied to the new qm.ini with the reference changed to DiagnosticMessages.

7 comments on"MQ Error Logging – New facilities"

  1. Reading the Knowledge Center Page (https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.con.doc/q018795_.html) that describes this, I believe that some corrections may be in order in your examples. Please do let me know if I’m incorrect since it means I have misunderstood the manual.

    1) You say:-
    “Whenever MQ generates an error log messages of either severity error or severe it will append it to AMQ001.ERR in directory /home/newlog/qmgr/qm1.”
    I believe the file name will actually be AMQERR01.LOG because you have not specified a prefix and the default is AMQERR, and it is Format=text so the file suffix will be .LOG

    2) You say:-
    “Whenever MQ generates an error log messages of either severity error or severe it will append it to QM001.ERR in directory /home/newlog/qmgr/qm2.”
    I believe the file name will actually be QM01.json because it is Format=json so the file suffix will be .json. Also the default value for Severities is all, so since you have not specified it, surely all severity messages will be recorded in this error file?

    Thanks,
    Morag

  2. Hello,

    How can you configure the logging in JSON format on the MQ Appliance?

    Thanks,
    Daniel

    • ElliotGregory May 30, 2018

      Hi Daniel

      Looking into your question I find that this facility is not available on Appliance.

      Thanks for your question.

      • Are these stanzas ignored by MQ Appliance if you set them using setmqini, or has setmqini not be updated to allow interaction with the DiagnosticMessages stanza?

        • ElliotGregory May 30, 2018

          The MQ Appliance has not been updated to support the new error logging facility. One of the many changes would be for the setmqini to be updated to accept the new stanza names. Currently the command will reject the new stanza names, such as DiagnosticMessages.

          Regards Elliot

          • Would be great to have this made available on the MQ Appliance asap. Because then it would make integration with Splunk much easier.

Join The Discussion

Your email address will not be published.