Posted: Tue Nov 23, 2004 2:58 pm Post subject: Writing API Exit log to WMQ Error logs
Acolyte
Joined: 25 Jun 2004 Posts: 52
Hi,
We have MQ API Exits (C programs) running on QMs on Windows and AIX. This API Exit inturn makes certain API calls. The existing program writes the events (like an API call within the exit program failing with some reason code etc.) to a separate file on the AIX box (using fprintf statments in C language).
I wanted to know if there is a way to write such events directly to the WMQ log (AMQERR0#.log of that QM or the log file at MQ level).
One way I can think of is to use fprintf on the AMQERR0#.log file. (For this, I have to hardcode the path of the file in the API Exit program or maintain a path variable in the system.)
Is there any other way of achieving this without the fprintf statements?
I do not think that is a very good idea, for several reasons.
1. The WMQ error logs are written to under lock. If you have another process writing to the file which disregards the locking protocol the likely result is an interleaving of text in the file.
2. The WMQ error logs are copied/renamed/truncated when they reach 256K. Again, if another process writes to the file sooner or later the text wil be lost when the file is truncated.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum