5. Logging

To simplify debugging, Qpid provides a logging facility that prints out messaging events.

5.1. Logging in C++

The Qpidd broker and C++ clients can both use environment variables to enable logging. Use QPID_LOG_ENABLE to set the level of logging you are interested in (trace, debug, info, notice, warning, error, or critical):

$ export QPID_LOG_ENABLE="warning+"

The Qpidd broker and C++ clients use QPID_LOG_OUTPUT to determine where logging output should be sent. This is either a file name or the special values stderr, stdout, or syslog:

export QPID_LOG_TO_FILE="/tmp/myclient.out"

5.2. Logging in Python

The Python client library supports logging using the standard Python logging module. The easiest way to do logging is to use the basicConfig(), which reports all warnings and errors:

from logging import basicConfig
basicConfig()

Qpidd also provides a convenience method that makes it easy to specify the level of logging desired. For instance, the following code enables logging at the DEBUG level:

from qpid.log import enable, DEBUG
enable("qpid.messaging.io", DEBUG)

For more information on Python logging, see http://docs.python.org/lib/node425.html. For more information on Qpid logging, use $ pydoc qpid.log.