Create your own message catalogs to write tailored entries to the local error log.
In some error and other situations, you might choose to write information to the error log so that you can track what is happening in a message flow. You can use the Throw and Trace built-in nodes to generate entries in the log, or you can create your own nodes and user exits, and write entries in the log from your user-defined extensions.
When you use these messages, you can also provide additional text that is displayed in the message text.
When you throw an exception from ESQL by using a THROW statement, the ESQL code adds an extra leading insert that contains the name of the current component. The rest of the inserts that are provided by the ESQL script follow this leading insert. Therefore, you must consider this insert when you are writing your own message catalog.
The instructions in this topic describe how to create message catalogs for C programs. If you want to create a Java™ resource bundle, refer to the documentation for the Java 2 Platform, Standard Edition.
Read the section appropriate to your broker operating system:
On Windows, you must create your additional message catalog as a DLL file. The DLL file contains definitions of your event messages, which the event viewer can display in a readable format, based on the event message written by your application. When you compile a message catalog, a header file is created that defines symbolic values for each event message number you have created. You must include the header file in your application.
To create an event source for the Windows Event Log Service:
On Linux, UNIX, and z/OS® systems, messages are written to the SYSLOG facility. If you want to use your own message catalog, you must create an XPG/4 message catalog.
The process for creating a message catalog (a .cat file) depends on the operating system on which you are creating it. The commands that you use are typically gencat (create or modify a message catalog) and dspcat (to display all or part of a message catalog). The gencat command merges text files that contain your message text, to create or modify a formatted catalog. The text files typically have a file extension of .msg.
export MQSI_CONSOLE_NLSPATH=${MQSI_CONSOLE_NLSPATH}:${MY_INST_PATH}/messages/%L/%N:${MY_INST_PATH}/messages/En_US/%N
In
this example, the English version is hardcoded later in the search
path, ensuring that messages are displayed even in locales for which
no .cat file exists. 1234 "MSG1234E: \
Syntax Error. \n
The value '{0}' is not valid for property '{1}'.\n
Correct it and then reissue the command.\n"
If you create a message catalog on one operating system, you cannot port it to another operating system because the catalogs are binary-encoded. However, you can use the same .msg files as input to the gencat command on another system.
See the relevant information in the documentation for your operating system. For example:
You must also check the information about additional supported locales, if you want to use messages in locales other than US English.