Grails
  1. Grails
  2. GRAILS-5729

Configuring Log4j in external config results in duplicate appenders

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1.1
    • Fix Version/s: None
    • Component/s: Configuration
    • Labels:
      None

      Description

      If you define a log4j closure in an external config file referenced from Config.groovy the initial configuration from Config.groovy remains and the new configuration is added in, but it doesn't replace the previous configuration options. This was different in 1.0 where it was property-based, but now that Log4j is configured using a DSL you can't override specific options, you have to redefine the whole closure.

      This is ok with log levels but appenders that are redefined but use the same file result in double log entries.

      LoggingGrailsPlugin calls LogManager.resetConfiguration() in onConfigChange and this is a workaround for external configs - add it as the first line if the log4j closure. But Log4jConfig.configure() should call LogManager.resetConfiguration() instead.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Burt Beckwith
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Last Reviewed:

              Development