The Message Queue provider defines a set of logging name spaces associated with logging levels and logging activities that allow Message Queue clients to log connection and session events when a logging configuration is appropriately set.
The root logging name space for the Message Queue client runtime is defined as javax.jms. All loggers in the Message Queue client runtime use this name as the parent name space.
The logging levels used for the Message Queue client runtime are the same as those defined in the java.util.logging.Level class. This class defines seven standard log levels and two additional settings that you can use to turn logging on and off.
Turns off logging.
Highest priority, highest value. Application-defined.
Application-defined.
Application-defined.
Application-defined
Application-defined.
Application-defined.
Lowest priority, lowest value. Application-defined.
Enables logging of all messages.
In general, exceptions and errors that occur in the Message Queue client runtime are logged by the logger with the javax.jms name space.
Exceptions thrown from the JVM and caught by the client runtime, such as IOException, are logged by the logger with the logging name space javax.jms at level WARNING.
JMS exceptions thrown from the client runtime, such as IllegalStateException, are logged by the logger with the logging name space javax.jms at level FINER.
Errors thrown from the JVM and caught by the client runtime, such as OutOfMemoryError, are logged by the logger with the logging name space javax.jms at level SEVERE.
The following tables list the events that can be logged and the log level that must be set to log events for JMS connections and for sessions.
The following table describes log levels and events for connections.
Table 3–6 Log Levels and Events for javax.jms.connection Name Space
Log Level |
Events |
---|---|
FINE |
Connection created |
FINE |
Connection started |
FINE |
Connection closed |
FINE |
Connection broken |
FINE |
Connection reconnected |
FINER |
Miscellaneous connection activities such as setClientID |
FINEST |
Messages, acknowledgments, Message Queue action and control messages (like committing a transaction) |
For sessions, the following information is recorded in the log record.
Each log record for a message delivered to a consumer includes ConnectionID, SessionID, and ConsumerID.
Each log record for a message sent by a producer includes ConnectionID, SessionID, ProducerID, and destination name.
The table below describes log levels and events for sessions.
Table 3–7 Log Levels and Events for javax.jms.session Name Space
Log Level |
Event |
---|---|
FINE |
Session created |
FINE |
Session closed |
FINE |
Producer created |
FINE |
Consumer created |
FINE |
Destination created |
FINER |
Miscellaneous session activities such as committing a session. |
FINEST |
Messages produced and consumed. (Message properties and bodies are not logged in the log records.) |
By default, the output log level is inherited from the JRE in which the application is running. Check the JRE_DIRECTORY/lib/logging.properties file to determine what that level is.
You can configure logging programmatically or by using configuration files, and you can control the scope within which logging takes place. The following sections describe these possibilities.