[
https://issues.apache.org/jira/browse/LOG4J2-2101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16245691#comment-16245691
]
ASF GitHub Bot commented on LOG4J2-2101:
----------------------------------------
Github user cakofony commented on the issue:
https://github.com/apache/logging-log4j2/pull/124
I would like to update MapMessage to take advantage of
`PatternFormatter.recursiveDeepToString` for more efficient value handling, but
I think that makes sense in a follow up commit.
I've got several MapMessage changes in review at the moment, so it's
difficult to push other fixes without stomping on my own feet!
> non-string value MapMessage ClassCastException
> ----------------------------------------------
>
> Key: LOG4J2-2101
> URL: https://issues.apache.org/jira/browse/LOG4J2-2101
> Project: Log4j 2
> Issue Type: Bug
> Components: Filters
> Affects Versions: 2.9.1
> Reporter: Carter Douglas Kozak
>
> Using a MapFilter with a MapMessage containing non-string values results in a
> ClassCastException attempting to cast values to strings.
> {noformat}
> 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)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)