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

Misleading StatusLogger WARN event in LogManager with java.util.Map

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.4
    • Component/s: API
    • Labels:

      Description

      In the class org.apache.logging.log4j.LogManager in the API package there is a logical problem with finding the factory.

      In the static initialization block starting at line 70 you try to create a factory instance from the factory class specified in the property "log4j2.loggerContextFactory". If that fails you try to find the class in all the supplied providers.

      The problem comes in line 104. You check whether the list of factories is empty and if it is not you automatically assume that there is more than 1 provider which has that class.

      Because of this I get the following logging entries on each startup:
      WARN StatusLogger Multiple logging implementations found:
      Factory: org.apache.logging.log4j.core.impl.Log4jContextFactory, Weighting: 10
      Using factory: org.apache.logging.log4j.core.impl.Log4jContextFactory

      As you can see, it clearly outputs only a single possible factory and also uses that one.

      Hope to see this fixed in 2.4 since it is really a minor issue.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Lemongrass Philipp Schneider
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified