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

Merging configurations fail with an NPE when comparing Nodes with different attributes

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.2
    • Fix Version/s: 2.7
    • Component/s: Configurators
    • Labels:
      None

      Description

      When you pass two configurations and there are different Nodes in the Root logger a NPE gets thrown.

      Example stub configuration 1

      <Loggers>
        <Root level="...">
          <AppenderRef ref="STDOUT">
          <Property name="hostname">server1</Property>
        </Root>
      </Loggers>
      

      Example stub configuration 2

      <Loggers>
        <Root level="...">
          <AppenderRef ref="STDOUT">
          <AppenderRef ref="File">
        </Root>
      </Loggers>
      

      Failure happens because DefaultMergeStrategy.isSameName() and isSameReference() calls get() without checking for null.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                leonj1 Jose Leon
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: