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

non-string value MapMessage ClassCastException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.9.1
    • Fix Version/s: 2.10.0
    • Component/s: Filters
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: