[logback-user] debug output when using Groovy configuration

sw at stinemail.com sw at stinemail.com
Thu May 9 19:26:31 CEST 2013


Thank you for logback and slf4j. We have found them very useful.

I would like to inquire about debugging output, starting with the 
intended behavior of the system property logback.debug.  It appears to 
have no effect if an application is configured via Groovy.  Setting 
logback.statusListenerClass does have some effect, though the output is 
not as verbose as with XML configuration.  I created a sample project 
that demonstrates the differences: 
https://github.com/dstine/logback-debug-groovy.  My experiments use the 
latest released version of logback 1.0.12.

My first question is, should logback.debug behave the same for both XML 
and Groovy configuration?  If yes, my next question is, how would we fix 
this?  I see the following code in ConfigurationAction (XML):


It looks like logback.debug is simply a shortcut for adding the status 
listener.  Is that correct, or is there anything else at play?  Should 
we "just" copy this code to ConfigurationDelegate (Groovy), or 
centralize it somehow?

Next, the output for Groovy config appears to not include information 
about configuring loggers, whereas XML config provides this output:

11:43:58,046 |-INFO in 
ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming 
default type ch.qos.logback.classic.encoder.PatternLayoutEncoder] for 
[encoder] property
11:43:58,078 |-INFO in 
ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of 
ROOT logger to DEBUG
11:43:58,078 |-INFO in 
ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender 
named [STDOUT] to Logger[ROOT]

Last, are there other differences I have not yet noticed?


More information about the Logback-user mailing list