Our Java-program talks to IBM MQ using IBM-provided com.ibm.mq.allclient JAR. As documented by IBM, log-messages generated from within the JAR are written out into mqjms.log in the current directory.

The above link explains, how the location -- and/or the filename -- can be changed, but that's all the flexibility there is documented...

Our own code uses log4j with appenders configured for both local files and for the corporate Splunk -- using Splunk's own JARs.

Is it possible to configure IBM MQ client JAR to feed log-entries directly into Splunk as well? Splunk document, how to feed their server from several Java logging frameworks -- is IBM MQ using any of them? Can it be made to?

Update: I'd rather not feed Splunk by way of printing -- be it into a file watched by Splunk Forwarding Agent -- or other means. Because the printed log-entry loses some information. And because multi-line entries (such as those with Java-exceptions) will generate a logging event for each line.

  • Could you install the splunk client forwarder to just tail that file locally?
    – Chopper3
    Nov 17, 2021 at 9:59
  • Besides pointing to a specific file the only other option you have is to tm point to System.err or System.out, could you use something like this to have System.err go to log4j which is then configured to send to splunk?
    – JoshMc
    Nov 17, 2021 at 10:08
  • Thanks for the suggestions -- I updated the question with the explanation, why I'd rather not go through text-file.
    – Mikhail T.
    Nov 17, 2021 at 21:28
  • Did you find a solution?
    – JoshMc
    Jul 8, 2022 at 0:38
  • @MikhailT. My suggestion was not the go through a file. My suggestion was to configure MQ to send messages to System.err or System.out and then per the link I provided redirect System.err or System.out to log4j configured like you mentioned with appenders configured for Splunk. This would not involve a text file.
    – JoshMc
    Dec 20, 2022 at 4:57


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.