Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-435

A logger's appenders are not cleared when configuring using XML configuration file (as the manual says)

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • 0.9.15
    • logback-classic
    • None

    Description

      The Logback manual says:

      "The <logger> element may contain zero or more <appender-ref> elements; each appender thus referenced is added to the named logger. It is important to keep mind that each named logger that is declared with a <logger> element first has all its appenders removed and only then are the referenced appenders attached to it. In particular, if there are no appender references, then the named logger will lose all its appenders. "

      However this doesn't seem to be the case. Our scenario is that we reset a context, configure it using one configuration file, then configure it using a second configuration file.

      This can be reproduced by configuring the same context with the same configuration file twice. The appenders added to a logger the first time are not cleared before adding them a second time, resulting in duplicate appenders.

      The latest version of LoggerAction and AppenderRefAction don't seem to have anything in them that would clear the appenders, either.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            richardfearn Richard Fearn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: