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

AbstractLogEvent should not implement getLevel()

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Core
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            cvent Christian Vent

            Dates

              Created:
              Updated:

              Slack

                Issue deployment