IBM MQ

Expand all | Collapse all

Logging MQ-message events to Windows event log?

  • 1.  Logging MQ-message events to Windows event log?

    Posted 9 days ago
    Hi,
    I have a customer requirement that includes logging certain messages activities to the windows event log. The win event log will then be polled for these events by a central third party logging system.

    The site has two QM in a cluster setup with version 9.1 on a win server.

    What needs to be logged is simply a timestamp, the messageId and the event. For example: msgId X put on queue Y on QM Z.

    I have looked into MQ's "Activity recording" but it looks from the docs that the the sending apps needs to change the messages for it to work. We really want to avoid having to change the sending apps.
    https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.1.0/com.ibm.mq.mon.doc/q036640_.htm 

    So, I think I have two questions.

    1. Is it possible to set "Activity recording" or something similar on a channel, queue or mcauser so we can avoid changing how the message is created? Or does someone have any other tricks to accomplish a similar result?

    2. Is it possible for MQ to write these events to win event log? How can that be done? Or do we need to write some code ourselves to do that?

    Thanks in advance for any input around this.
    /Daniel



  • 2.  RE: Logging MQ-message events to Windows event log?

    Posted 8 days ago
    What you really want to do, is to look at the topics for activity recording.
    You will then need to create your own application to write the info you seek into the log.
    See https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.1.0/com.ibm.mq.mon.doc/mo00040_.htm

    ------------------------------
    Francois Brandelik
    ------------------------------



  • 3.  RE: Logging MQ-message events to Windows event log?

    Posted 8 days ago
    I believe you will need to develop a channel exit to capture the data you want, usually to a file.

    https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.dev.doc/q027990_.htm

    ------------------------------
    Enio Marques Junior
    ------------------------------



  • 4.  RE: Logging MQ-message events to Windows event log?

    Posted 7 days ago
    Hi Daniel,

    I am not that familiar with running MQ on Windows, but I'd guess you'll need some amount of custom code to get the
    events to event log. If getting each of the message ids isn't mandatory, you can get the details using MQ statistics message.
    https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.1.0/com.ibm.mq.mon.doc/q037490_.htm
    You just have to get the messages from queue manager and extract the stats from PCF formatted message.
    For example, we are using Splunk for monitoring and it gets the messages directly from queue manager using a 
    modular input. We have a simple Java class that converts PCF to JSON at the input. 

    One solution would be an exit, but I think getting the message id is still an issue. Message exit gives you access to MQMD, 
    but it is only applicable for message channels. Data Conversion exit could also be used, but it is invoked only during an MQGET call.

    ------------------------------
    Hermanni Pernaa
    ------------------------------



  • 5.  RE: Logging MQ-message events to Windows event log?

    Posted 7 days ago

    You don't have to change the application to use Application Activity Trace - which would be a better feature to use than the "Trace Route" and "Activity Reports" you have found.

    Here's a presentation you can read all about Activity Trace that might help to explain how to use it.

    Whichever feature you decide to use, you will need to create something that will read the PCF messages that MQ emits, and write whatever you need to see in the Windows Event Log.

    It also worth noting that it is unusual to require a log for every message that is put or got. If you're doing millions of messages a day, how can you realistically make use of such a log? Is there a specific requirement behind this?

    Cheers,
    Morag



    ------------------------------
    Morag Hughson
    MQ Technical Education Specialist
    MQGem Software Limited
    ------------------------------



  • 6.  RE: Logging MQ-message events to Windows event log?

    Posted 3 days ago
    Hi Daniel,

    What you're trying to do is non trivial but possible. Presumably there is an actual requirement of looking a the behaviour of certain messages or transactions and tracking or tracing them. What is the business requirement? Is it IT tracing or performance monitoring or business tracking? It doesn't help that they're asking you to use their partially designed solution of going via the windows event log on, presumably, the same server. When you say " logging certain messages activities" do you mean certain messages or certain activities? Looking at a lot of messages and filtering them and putting the messages or the activities into the event log could have a significant performance impact, and maybe financial if you have to upgrade the server to handle it. Presumably you don't really need them in the event log, you need a way to analyse them, or integration to a third party message tracking tool. 

    I would suggest that you take a look at Nastel's free XRay for MQ which does this message tracking and analytics. Most of the hard work can be handled on a separate server, on premise or on Nastel's cloud. You can read about it in my post here https://www.nastel.com/getting-started-using-nastel-xray-for-mq/

    Or you can read about the appliction activity events here https://www.nastel.com/how-well-do-you-know-amqsact/

    Hope that helps,

    ------------------------------
    Sam Garforth
    Managing Director, EMEA
    Nastel Technologies
    Southampton
    ------------------------------



  • 7.  RE: Logging MQ-message events to Windows event log?

    Posted 3 days ago
    Hi Daniel,
    What you're trying to do is non trivial but possible. Presumably there is an actual requirement of looking a the behaviour of certain messages or transactions and tracking or tracing them. It doesn't help that they're asking you to use their partially designed solution of going via the windows event log on, presumably, the same server. When you say " logging certain messages activities" do you mean certain messages or certain activities? Looking at a lot of messages and filtering them and putting the messages or the activities into the event log could have a significant performance impact, and maybe financial if you have to upgrade the server to handle it. Presumably you don't really need them in the event log, you need a way to analyse them, or integration to a third party message tracking tool. What is the business requirement? Is it IT tracing or performance monitoring or business tracking?

    I would suggest that you take a look at Nastel's free XRay for MQ which does this message tracking and analytics. Most of the hard work can be handled on a separate server, on premise or on Nastel's cloud. You can read about it in my post here https://www.nastel.com/getting-started-using-nastel-xray-for-mq/

    Or you can read about the appliction activity events here https://www.nastel.com/how-well-do-you-know-amqsact/

    Hope that helps,

    ------------------------------
    Sam Garforth
    Managing Director, EMEA
    Nastel Technologies
    Southampton
    ------------------------------