[ 
https://issues.apache.org/jira/browse/LOG4J2-2101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16245988#comment-16245988
 ] 

ASF GitHub Bot commented on LOG4J2-2101:
----------------------------------------

GitHub user cakofony opened a pull request:

    https://github.com/apache/logging-log4j2/pull/129

     LOG4J2-2101:  LOG4J2-2102:  LOG4J2-2107:  LOG4J2-2112: MapMessage 
Improvements

    This branch/pr combines #124 #125 #126 as well as a commit resolving  
LOG4J2-2112.
    
    The previous separate PRs were stacking up and conflicting with others, 
using a single branch to queue them up instead.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cakofony/logging-log4j2 
combined_map_message_changes

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/logging-log4j2/pull/129.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #129
    
----
commit 7e41ab8529387e532dd0bd291128dca04d6161b4
Author: Carter Kozak <[email protected]>
Date:   2017-11-06T18:14:36Z

    LOG4J2-2101: MapMessage correctly handles non-string map values
    
    Previously formatting non-string values worked, however filtering,
    which uess the "get" method would fail due to MapMessage attempting
    to cast values to String.

commit 1df0fad4e6cab9708eeb98fa2a13818b70879d4b
Author: Carter Kozak <[email protected]>
Date:   2017-11-06T18:49:36Z

    LOG4J2-2102: MapMessage Json and XML encodings escape keys and values

commit 611a3cfa2f56bc44938f75b85939f3d9a33a9a35
Author: Carter Kozak <[email protected]>
Date:   2017-11-08T21:53:31Z

    LOG4J2-2107: MapMessage allocation-free pattern conversion
    
    Fixes an issue causing MessagePatternConverter to greedily format
    MapMessage instances as StringBuilderFormattable ignoring format.

commit 3aa0d376ee84813e1fba76d1efb0983a2cb9ff23
Author: Carter Kozak <[email protected]>
Date:   2017-11-08T22:08:22Z

    StructuredDataMessage implements MultiFormatStringBuilderFormattable

commit 25cbea0b48496248b61564fbb1c4e4b0d5f01a13
Author: Carter Kozak <[email protected]>
Date:   2017-11-09T16:36:01Z

    LOG4J2-2112: MapMessage values use deep toString
    
    This allows for more efficient StringBuilder usage and usage of
    StringBuilderFormattable MapMessage values.

----


> 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)

Reply via email to