This is part of a series of small blog posts which will cover some of the smaller, perhaps less likely to be noticed, features of IBM MQ. Read other posts in this series.
In the dim and distant past, the default value for the maximum size of a queue manager error log file on the distributed platforms was 2MB (and before that it was 256K). Now-a-days, the default value is 32MB. The value is the size at which the error logs "rollover". That is, when AMQERR02.LOG is renamed to AMQERR03.LOG and 1 to 2, and new messages are written to a new file named AMQERR01.LOG.
You may have noticed this difference in maximum size depending on what you use to view your MQ error log files. I use Notepad on Windows and there is a noticeable difference in the time it takes to open a larger file since it is, after all, a very simple text file viewer.
This default was changed in IBM MQ V9.0.4 and only applies if you do not explicitly configure the maximum size for your error logs. For some history on controlling error log sizes from even longer ago, check out this post by T.Rob.
A larger error log file has advantages because you are able to keep a longer history of the error messages written by your queue manager. It does however use up more space on your file system. So a balance may need to be struck.
I'm going to show you how to set the size of your queue manager error logs on an existing queue manager and also how to do this using the new automatic configuration of qm.ini at startup for any new queue managers you create.
The short answer is that you need to set something like the following in your qm.ini file. This would set your queue manager error log maximum size back to the 2MB default it had in V9.0.4 and earlier. If you are used to editing your qm.ini file then this is the way to go for you. Restart your queue manager and once AMQERR01.LOG exceeds this size the error logs will rollover. Note that the existing files will not shrink.
QMErrorLog:
ErrorLogSize=2097152
If you have a queue manager creation script and regularly make new queue managers and you don't want to remember every time to set the size of the error logs, you may be interested in using the automatic configuration of qm.ini at startup feature.
To do this, create a ini file with the above contents in a central directory, perhaps alongside your queue manager creation script.
Once created, this script can be used when creating a new queue manager, and its contents will be copied into the new queue manager's qm.ini file.
crtmqm -ii c:\mqgem\scripts\default.ini MQG1
Every time you start this queue manager, it will report:
Successfully applied automatic configuration INI definitions.
IBM MQ queue manager 'MQG1' starting.
If you inspect this queue manager's qm.ini file you will see the following.
AutoConfig:
IniConfig=c:\mqgem\scripts\default.ini
QMErrorLog:
ErrorLogSize=2097152
A word of warning though; if you are used to editing your qm.ini file directly, then beware that any changes you make must now be made to the file referred to by IniConfig and not to the queue manager's qm.ini file directly, since that file will be thrown away and rebuilt at startup from the referenced file.
If you are working with a queue manager you are unfamiliar with and you view its qm.ini file and see the AutoConfig stanza and an IniConfig attribute, also beware that you should not be editing this file as your changes will not stay.
#Little-Gem
#IBMMQ
#IBMChampion