Chapter 9. Logging


Logging is important in troubleshooting and debugging. protonJ2 uses slf4j as its logger for full configuration options see Slf4j Manual.

9.1. Configuring a simple logger with slf4j

To configure a simple logger using slf4j create a file `simplelogger.properties and configure like so:

Example Simple Logger

org.slf4j.simpleLogger.logFile=System.out

org.slf4j.simpleLogger.defaultLogLevel=warn

org.slf4j.simpleLogger.showDateTime=true
org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss,SSS

org.slf4j.simpleLogger.log.org.apache.qpid.protonj2=warn
org.slf4j.simpleLogger.log.org.apache.qpid.protonj2.client=warn

9.2. Enabling protocol logging

The following code writes AMQP frames to the console.

Example: Logging AMQP frames

    ConnectionOptions options = new ConnectionOptions();
    options.traceFrames(true);

Alternatively you get set the environment variable PN_TRACE_FRM to true;

Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top