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

AbstractLogEvent should not implement getLevel()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None

      Description

      According to LOG4J2-462 a LogEvent should never return null for getLevel(). But org.apache.logging.log4j.core.AbstractLogEvent is currently returning null as level, which will lead to an NPE, if one extends this class to create an own LogEvent, without overriding the getLevel() method.

      Suggestion is to remove getLevel() from the abstract class, to force developers to decide which level should be returned.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                cvent Christian Vent
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: