Logback Config – Showing Debug Level
Join the DZone community and get the full member experience.
Join For FreeShowing Debug Logback Configuration
Logback provides the functionality to enable debug level output of its own status.
<?xml version="1.0" encoding="UTF-8"?> <configuration debug="true">
yields
INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy] INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback-test.xml] at [file:/code/MyProject/target/test-classes/logback-test.xml] INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender] INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [console] INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.myco] to DEBUG INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.springframework.test.web.servlet] to TRACE INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.springframework.web.servlet] to TRACE INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to WARN INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [console] to Logger[ROOT] INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration. INFO in ch.qos.logback.classic.joran.JoranConfigurator@2c17306 - Registering current configuration as safe fallback point
However, I started using the logback.groovy
configuration and I cannot seem to find a way to enable debug in the groovy config. We can turn on debug info via an environment variable logback.debug
- Environment Variable:
logback.debug=true
- Java Define:
-Dlogback.debug=true
Debug (command)
Published at DZone with permission of Gordon Dickens, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending
-
RAML vs. OAS: Which Is the Best API Specification for Your Project?
-
Five Java Books Beginners and Professionals Should Read
-
A Complete Guide to AWS File Handling and How It Is Revolutionizing Cloud Storage
-
How To Use Geo-Partitioning to Comply With Data Regulations and Deliver Low Latency Globally
Comments