Debugging JVM Logging Issues

There are times in every Java / JVM developer’s life when you need to figure out what is happening at the log level. Maybe an issue in a 3rd party library, or maybe you’re stumped by the behavior if the logging library itself.

You can use the following JVM args to debug logging problems across all logging types:

JAVA_OPTS="-Dlog4j.debug=true -Dlogback.debug=true -Dslf4j.debug=true -Dlogback.statusListenerClass=ch.qos.logback.core.status.OnConsoleStatusListener"

This enables debug logging for log4j, logback, and slf4j. It also outputs log change events to the console, so if you’re application is programmatically updating log levels you’ll have some idea where and when.

Tagged with: , , , , ,
Posted in Uncategorized
Design a site like this with WordPress.com
Get started