[logback-user] debug output when using Groovy configuration

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


Hi,

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):

https://github.com/qos-ch/logback/blob/71886409e62533af0bdf1d922a7d66f3818d42db/logback-classic/src/main/java/ch/qos/logback/classic/joran/action/ConfigurationAction.java#L47-L52

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?

Thanks,
Dan


More information about the Logback-user mailing list