diff options
author | sebright <sebright@google.com> | 2018-09-17 16:59:04 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-17 16:59:04 -0700 |
commit | 7aab20a9704ceb544bdb01974134c56c7aedc0f2 (patch) | |
tree | 02154d35f99b09b13dcd89d276c77aeb6bb1ad95 /CHANGELOG.md | |
parent | 69360e984884902e60c0ffafe4c73a18702896ad (diff) | |
download | opencensus-java-7aab20a9704ceb544bdb01974134c56c7aedc0f2.tar.gz |
Fix ClassCastException in opencensus-contrib-log-correlation-log4j2. (#1437)
Fixes #1436.
Log4j's SortedArrayStringMap can contain Object values, but
`SortedArrayStringMap.getValue` has signature `<V> V getValue(String key)` and
unsafely casts the Objects to type `V`. When the OpenCensus ContextDataInjector
returned a SortedArrayStringMap, and then a Log4j ContextMapLookup looked up
values as Strings to insert them into log entries
(https://github.com/apache/logging-log4j2/blob/fa27894c13c3890e4ae545f6b6365ea2e159757c/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/ContextMapLookup.java#L58),
it resulted in a ClassCastException.
This commit fixes the ClassCastException by only inserting String values into
the Log4j SortedArrayStringMap.
Diffstat (limited to 'CHANGELOG.md')
0 files changed, 0 insertions, 0 deletions