Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-405

Log4jConfigListener is starting LoggerContext twice

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta9
    • Fix Version/s: 2.0-rc1
    • Component/s: Configurators
    • Labels:
      None

      Description

      While debugging my log4j2.0 configuration in web application, I have observed that the LoggerContext.start() is called twice once without parameter and next with Configuration parameters.
      Following are stack paths to these calls.

      1st path:

      LoggerContext.start() line: 145
      Log4jContextFactory.getContext(String, ClassLoader, boolean, URI) line: 104
      Log4jContextFactory.getContext(String, ClassLoader, boolean, URI) line: 34
      LogManager.getContext(ClassLoader, boolean, URI) line: 187
      Configurator.initialize(String, ClassLoader, URI, Object) line: 103
      Configurator.initialize(String, ClassLoader, String, Object) line: 63
      Log4jWebInitializerImpl.initializeNonJndi(String) line: 136
      Log4jWebInitializerImpl.initialize() line: 82

      2nd Path:

      LoggerContext.start(Configuration) line: 175
      Configurator.initialize(String, ClassLoader, URI, Object) line: 111
      Configurator.initialize(String, ClassLoader, String, Object) line: 63
      Log4jWebInitializerImpl.initializeNonJndi(String) line: 136
      Log4jWebInitializerImpl.initialize() line: 82

      During first path, it is basically calling reconfigure.

        Attachments

        1. log4j2.0-test.zip
          3 kB
          Poorna Subhash P
        2. log4j2.0.log
          7 kB
          Poorna Subhash P

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              poorna Poorna Subhash P
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: