Skip to content

Conversation

KarstenSchnitter
Copy link
Contributor

Log4j can provide different context data depending on its configuration.
In one case the provided context map is unmodifiable. In that case an
exception occurred, when a custom field was used as a message parameter.
This change guards against that issue, by defensively creating a modifiable
map of properties. Then the custom fields can be added safely.

Log4j can provide different context data depending on its configuration.
In one case the provided context map is unmodifiable. In that case an
exception occurred, when a custom field was used as a message parameter.
This change guards against that issue, by defensively creating a modifiable
map of properties. Then the custom fields can be added safely.
Copy link
Member

@christiand93 christiand93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation seems to be a bit off. Besides that it looks good to me.

There were remnants from a wrong formatting in the fils.
@KarstenSchnitter KarstenSchnitter merged commit 16e8e3c into master Jan 24, 2022
@KarstenSchnitter KarstenSchnitter deleted the log4j-uoe branch January 24, 2022 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom Fields might lead to "java.lang.UnsupportedOperationException" with log4j2
2 participants