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

Log4j 1.2 bridge getAllAppenders() returns null enumeration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.17.2
    • 2.18.0
    • Log4j 1.2 bridge
    • None

    Description

      Old application using Log4j 1.2.x relies on Logger.getAllAppenders() to decide if Log4j it's already configured (returned Enumeration has at least 1 appender) or not (empty returned Enumeration).

      Some recent code audits mandate to remove log4j v1 component(s) and to upgrade to latest 2.17.2 release, so we're using Log4j 1.2 Bridge to comply and not to change application code.

      However, we're facing the issue describe here [1] for Logger.getRootLogger().getAllAppenders() although with latest Log4j release 2.17.2 the issue seems to be that data structure aai is never updated with the proper configured appenders, given that now most of the work happens in the Log4j v2 Core implementation, thus using LoggerContext

      [1] java - Log4j getAllAppenders() returns null enumeration - Stack Overflow

       

       

      Attachments

        Issue Links

          Activity

            People

              pkarwasz Piotr Karwasz
              pablojr Pablo Rogina
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: