[prev in list] [next in list] [prev in thread] [next in thread] 

List:       logback-user
Subject:    Re: [logback-user] logback.debug?
From:       Ceki Gulcu <ceki () qos ! ch>
Date:       2007-04-21 20:22:53
Message-ID: 462A729D.6040100 () qos ! ch
[Download RAW message or body]

Hi Dirk,

Sorry for the late reply.

I believe that logback's internal status reporting is one of its strong points. 
Basically, all logback modules (logback-core, logback-classic and 
logback-access) revolve around a context, a LoggerContext in case of 
logback-classic. All problems encountered during the lifetime of the context are 
reported through status messages which are added to a StatusManager. Each 
context has its own separate StatusManager.

Thus, whenever you wish to print the internal status of a context, you call
StatusPrinter.print(context). In logback-classic, the exact steps would be


  LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
  StatusPrinter.print(lc);

For more complete examples see "Chapter 2 - Architecture" [1] section entitled 
"Configuration" and especially the MyAppWithConfigFile class [2].

I hope this helps,

[1] http://logback.qos.ch/manual/architecture.html
[2] http://logback.qos.ch/xref/chapter2/MyAppWithConfigFile.html


dirk ooms wrote:
> Hi,
> 
> i would like to watch the 'internal' logging of logback to check whether 
> logback is happy with the provided logback.xml (similar to using the 
> log4j.debug in log4j), but i am not sure how to do this. i noticed the 
> existence of StatusManager, but it's not clear to me how to use it.
> 
> thanks for any guidance on this,
> dirk 

-- 
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch
_______________________________________________
Logback-user mailing list
Logback-user@qos.ch
http://qos.ch/mailman/listinfo/logback-user
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic