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_.htmYou 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
------------------------------
Original Message:
Sent: Tue May 19, 2020 04:45 PM
From: Daniel Friberg
Subject: Logging MQ-message events to Windows event log?
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.
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