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

non-string value MapMessage ClassCastException

    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

          People

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

            Dates

              Created:
              Updated:
              Resolved: