[
https://issues.apache.org/jira/browse/LOG4J2-1692?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15663283#comment-15663283
]
ASF GitHub Bot commented on LOG4J2-1692:
----------------------------------------
Github user GregDThomas commented on a diff in the pull request:
https://github.com/apache/logging-log4j2/pull/48#discussion_r87763577
--- Diff:
log4j-api/src/main/java/org/apache/logging/log4j/CloseableThreadContext.java ---
@@ -128,6 +153,37 @@ public Instance put(final String key, final String
value) {
}
/**
+ * Populates the Thread Context Map with the supplied key/value
pairs. Any existing keys in the
+ * {@link ThreadContext} will be replaced with the supplied
values, and restored back to their original value when
+ * the instance is closed.
+ *
+ * @param values The map of key/value pairs to be added
+ * @return a new instance that will back out the changes when
closed.
+ * @since 2.7.1
+ */
+ public Instance putAll(final Map<String, String> values) {
--- End diff --
OK, I'm not personally convinced, but will make the appropriate changes.
> putAll() method for CloseableThreadContext
> ------------------------------------------
>
> Key: LOG4J2-1692
> URL: https://issues.apache.org/jira/browse/LOG4J2-1692
> Project: Log4j 2
> Issue Type: Improvement
> Components: API
> Affects Versions: 2.6, 2.7
> Reporter: Greg Thomas
> Assignee: Mikael Ståldal
> Priority: Minor
>
> The ThreadContext supports a putAll(final Map<String, String> m) method.
> It would be useful, particularly when using thread pools, to have a similar
> method for the CloseableThreadContext.
> Similarly, a pushAll() method would be useful.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]