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

non-string value MapMessage ClassCastException

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.9.1
    • 2.10.0
    • Filters
    • None

    Description

      Using a MapFilter with a MapMessage containing non-string values results in a ClassCastException attempting to cast values to strings.

      ClassCastException: java.lang.Long cannot be cast to java.lang.String
          at org.apache.logging.log4j.message.MapMessage.get(MapMessage.java:214)
          at org.apache.logging.log4j.core.filter.MapFilter.filter(MapFilter.java:87)
          at org.apache.logging.log4j.core.filter.MapFilter.filter(MapFilter.java:79)
          at org.apache.logging.log4j.core.filter.AbstractFilterable.isFiltered(AbstractFilterable.java:182)
          at org.apache.logging.log4j.core.config.AppenderControl.isFilteredByAppender(AppenderControl.java:151)
          at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:128)
      

      Attachments

        Activity

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

          People

            mikaelstaldal Mikael Ståldal
            ckozak Carter Kozak
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment