[logback-dev] [JIRA] Commented: (LBCLASSIC-265) Logging stops if invalid xml configuration is loaded by scanner

Iwein Fuld (JIRA) noreply-jira at qos.ch
Thu May 12 09:58:52 CEST 2011

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

Iwein Fuld commented on LBCLASSIC-265:

The ideal solution is pretty clear to me: load the configuration first, then swap the contexts only if the loading was successful. Even if this doesn't happen entirely thread-safe, it would fix this issue. The relevant question is how to modify logback code to get close enough to this situation to fix this bug. After trying for an hour or so last week I can say it will be trickier than I hoped, but that's normal.

I came up with some strategies that are not very invasive and open the door to a larger refactoring that attacks the design problem I mentioned.

1. run the JoranConfigurator against a throwaway context first and only reset after that worked

2. wrap the context in a delegator that can swap the internal context instead of modifying it

I haven't tried these strategies yet, but I think they can be made to fix the problem and the second one could be made threadsafe and atomic. Thoughts?

> Logging stops if invalid xml configuration is loaded by scanner
> ---------------------------------------------------------------
>                 Key: LBCLASSIC-265
>                 URL: http://jira.qos.ch/browse/LBCLASSIC-265
>             Project: logback-classic
>          Issue Type: Bug
>    Affects Versions: 0.9.28
>            Reporter: Iwein Fuld
>            Assignee: Logback dev list
> When logging with scan="true" it is possible to stop all logging of an application silently.
> Steps to reproduce:
> - start an application with valid configuration and scan=true
> - break the logback.xml (leave out a quote or something)
> -> log goes silent
> Expected behavior:
> Logger fails to load new config and keeps running on the old configuration (like when valid xml, but invalid configuration is loaded).

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