[logback-dev] [JIRA] Commented: (LBCLASSIC-58) Print Logback own erros to System.out if debug is enabled?

Ceki Gulcu (JIRA) noreply-jira at qos.ch
Wed Aug 6 22:38:25 CEST 2008


    [ http://jira.qos.ch/browse/LBCLASSIC-58?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10632#action_10632 ] 

Ceki Gulcu commented on LBCLASSIC-58:
-------------------------------------

Why hasn't the debug attribute work for you? That's surprising...  The debug attribute within the configuration tag will cause Joran to print
out its status messages when its done configuring logback.  The only time that does not work is when the config file can't be found or is
not well-formed XML. The event listener approach won't solve that problem (assuming the listener is specified within the config file).
However, if you programmatically set the listener, e.g. 

  LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); 
  lc.getStatusManager().addStatusListener(new MySystemOutPrintingListener());

which is not very different than what you had previously

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

Moreover, for the listener to have an affect for cases the debug attribute does not work, the listener must have been set before logback configuration occurs, which would be relatively tricky to accomplish. 

I am under the impression that listeners do not provide an answer to the problem you seem to be describing.


> Print Logback own erros to System.out if debug is enabled?
> ----------------------------------------------------------
>
>                 Key: LBCLASSIC-58
>                 URL: http://jira.qos.ch/browse/LBCLASSIC-58
>             Project: logback-classic
>          Issue Type: Improvement
>            Reporter: Anton Tagunov
>            Assignee: Logback dev list
>            Priority: Minor
>
> Hello Ceki, when debug is enabled lots of messages to to System.out anyway.
> Do you think it would be a good idea to also print messages going to StatusManager to System.out?
> Apparently there is huge demand for this feature.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list