- Environment variables — adjust log levels for specific packages without redeploying a config file
- Config file — full control over appenders, patterns, and per-logger levels
Configure with environment variables
The default config reads these env vars. Set any of them in your deployment to adjust levels without touching the config file:| Variable | Default | Controls |
|---|---|---|
LOG4J2_ROOT_LEVEL | info | Root log level for all loggers |
LOG4J2_APPENDER_LAYOUT | pattern | Output format: pattern (human-readable) or json |
LOG4J2_IO_CONDUKTOR_LEVEL | info | All Conduktor application logs |
LOG4J2_ORG_APACHE_KAFKA_LEVEL | warn | Kafka client library logs |
LOG4J2_IO_VERTX_LEVEL | warn | Vert.x framework logs |
LOG4J2_IO_NETTY_LEVEL | error | Netty network framework logs |
LOG4J2_IO_CONDUKTOR_PROXY_AUTHORIZATION_LEVEL | info | Authorization decision logs |
LOG4J2_IO_CONDUKTOR_PROXY_NETWORK_LEVEL | info | Proxy network connection logs |
LOG4J2_IO_CONDUKTOR_UPSTREAM_THREAD_LEVEL | warn | Upstream broker thread logs |
LOG4J2_APPENDER_LAYOUT=json.
Use a config file
To further customize your logging at an individual logger-level, you can use a custom log4j configuration file. First, bind your custom log4j configuration file to the/app/resources/log4j2.xml path in the container.
Here’s the default configuration file: