[logback-dev] [JIRA] Issue Comment Edited: (LBCLASSIC-130) Multiple resource warning is not appropriate for logback-test.xml

Ceki Gulcu (JIRA) noreply-jira at qos.ch
Wed Jul 21 12:58:16 CEST 2010


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

Ceki Gulcu edited comment on LBCLASSIC-130 at 7/21/10 12:56 PM:
----------------------------------------------------------------

Jon Vincent writes: "Every test in the project will therefore emit this warning when run from the IDE." 

The warning is emitted when the StaticLoggerBinder class is loaded into memory, which happens once per JVM launch.  So, if you are running several tests in a suite, the warning will be emitted only once, at the beginning. Only for tests run individually will the warning will be emitted per test. 

There are inconveniences involved in using INFO instead of WARN: 

 1) multiple messages will still be output, one per resource plus the initial message about logback-*.xml occuring multiple times.
 2) what if the multiple resource occurrence is unintentional? In that case, we lose an opportunity to warn the user about a likely error.

      was (Author: noreply.ceki at qos.ch):
    Jon Vincent writes: "Every test in the project will therefore emit this warning when run from the IDE." 

The warning is emitted when the StaticLoggerBinder class is loaded into memory, which happens once per JVM launch.  So, if you are running several tests in a suite, the warning will be emitted only once, at the beginning. Only for tests run individually will the warning will be emitted per test. 

There inconveniences involved in using INFO instead of WARN: 

 1) there will still be multiple messages lines output, one per resource plus the initial message about logback-*.xml occuring multiple times.
 2) what if the multiple resource occurrence is unintentional. In other words, we lose an opportunity to warn the user about a likely error.
  
> Multiple resource warning is not appropriate for logback-test.xml
> -----------------------------------------------------------------
>
>                 Key: LBCLASSIC-130
>                 URL: http://jira.qos.ch/browse/LBCLASSIC-130
>             Project: logback-classic
>          Issue Type: Improvement
>    Affects Versions: 0.9.14, 0.9.15, 0.9.16
>            Reporter: Jon Vincent
>            Assignee: Ceki Gulcu
>            Priority: Minor
>
> When LBCLASSIC-85 was fixed, it also applied to logback-test.xml. Unfortunately, some IDEs (such as Eclipse) include the test classpath for all modules in a multi-module project -- which means that it's nearly impossible to avoid having multiple logback-test.xml files on the classpath if one project depends on another when running tests in Eclipse. Every test in the project will therefore emit this warning when run from the IDE.
> Is it possible to have the ContextInitializer only emit this warning for logback.xml, and not logback-test.xml? This would avoid a spurious/unactionable warning for developers using Eclipse. 

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