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

No Warning if Lookup is defined twice in different dependencies

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.13.3
    • None
    • Configuration, Lookups
    • None

    Description

      A long time ago I defined a Lookup called `event` and used it as a dependency for other projects. Somewhen in the meantime, log4j2 added a event lookup as well.

      Now my configured pattern does not work anymore, because it uses the internal lookup instead. However, it does not show a warning that there is already a lookup with that name.

      It is even more confusing, that if I add the related Log4j2Plugins.dat directly to my project, it uses my Lookup instead of Log4j2's (no warnings). Thats why I didn't notice it during my tests.

       

      I only found out about log4j2's new lookup after adding the `packages` attribute to my log4j2.xml. Only then do I get a warning and then even twice directly:

      > 2020-08-19 10:57:12,731 main WARN Plugin [event] is already mapped to class org.apache.logging.log4j.core.lookup.EventLookup, ignoring class my.example.LogEventLookup
      > 2020-08-19 10:57:13,450 main WARN Plugin [event] is already mapped to class org.apache.logging.log4j.core.lookup.EventLookup, ignoring class my.example.LogEventLookup

      Attachments

        Activity

          People

            Unassigned Unassigned
            ST-DDT D T
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: