-
Notifications
You must be signed in to change notification settings - Fork 102
Fix context data with non-String values #261
Fix context data with non-String values #261
Conversation
@@ -172,11 +173,19 @@ private String getValue(MdcMessageField field) { | |||
@Override | |||
public String getMdcValue(String mdcName) { | |||
ReadOnlyStringMap contextData = logEvent.getContextData(); | |||
if (null != contextData && contextData.containsKey(mdcName)) { | |||
return contextData.getValue(mdcName); | |||
if (null == contextData) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about converting the value ourselves to String
? Creating another map imposes quite significant allocations?
4b2aab2
to
dda9abe
Compare
Ouch, you're right! I actually used |
I just amended the commit and force-pushed. No need to have the old solution in the history. |
Because I check for null now I could of course just use |
dda9abe
to
5d1e2bb
Compare
Never mind, I changed it. |
Thank you for your contribution. That's merged and polished now. |
Make sure that: