Logging errors for IBM MQ classes for JMS

By default, log output is sent to the mqjms.log file. You can redirect it to a specific file or directory.

About this task

The IBM® MQ classes for JMS log facility is provided to report serious problems, particularly problems that might indicate configuration errors rather than programming errors. By default, log output is sent to the mqjms.log file in the JVM working directory.

You can redirect log output to another file by setting the property com.ibm.msg.client.commonservices.log.outputName. The value for this property can be:
  • A single path name.
  • A comma-separated list of path names (all data is logged to all files).
Each path name can be:
  • Absolute or relative.
  • stderr or System.err to represent the standard error stream.
  • sttdout or System.out to represent the standard output stream.

If the value of the property identifies a directory, log output is written to mqjms.log in that directory. If the value of the property identifies a specific file, log output is written to that file.

Procedure

  • Set the property com.ibm.msg.client.commonservices.log.outputName in the IBM MQ classes for JMS configuration file or as a system property on the java command.
    In the following example, the property is set as a system property and identifies a specific file:
    
    java -Djava.library.path= library_path
    -Dcom.ibm.msg.client.commonservices.log.outputName=/mydir/mylog.txt
    MyAppClass
    
    In the command, library_path is the path to the directory containing the IBM MQ classes for JMS libraries (see Configuring the Java Native Interface (JNI) libraries ).
    The values System.err and System.out can be set to send log output to the System.err and System.out streams.
  • To disable log output, set the property com.ibm.msg.client.commonservices.log.status to OFF. The default value of this property is ON.