Putting null keys on a MapMessage
shouldn't be throwing exception
#2009
LoganDev99
started this conversation in
General
Replies: 2 comments 5 replies
-
@LoganDev99, you might indeed be right. Do you have a particular use case that caused this exception? |
Beta Was this translation helpful? Give feedback.
4 replies
-
@ppkarwasz Comparing how SLF4J handles a ThreadContext map entry vs how we handle a MapMessage should not be considered to have the same behavior. That said, I don't believe we should always accept nulls. At best, it is fair to say that the behavior when a null value is passed is undefined (or up to the implementation). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Looks like using MapMessage with null values causes a IllegalArgumentException to be thrown. I think that MapMessage should be able to accept nulls or the logger should be able to handle the exception.
logging-log4j2/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
Line 205 in 613b520
Beta Was this translation helpful? Give feedback.
All reactions