[
https://issues.apache.org/jira/browse/LOG4J2-1611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Remko Popma resolved LOG4J2-1611.
---------------------------------
Resolution: Fixed
> Improve performance of ThreadContextDataInjector.ForDefaultThreadContextMap
> ---------------------------------------------------------------------------
>
> Key: LOG4J2-1611
> URL: https://issues.apache.org/jira/browse/LOG4J2-1611
> Project: Log4j 2
> Issue Type: Improvement
> Components: Core
> Affects Versions: 2.7
> Reporter: Remko Popma
> Assignee: Remko Popma
> Fix For: 2.7
>
> Attachments: InjectWithProperties.png, InjectWithoutProperties.png,
> ThreadContext-Get.png, ThreadContext-PutAndRemove.png
>
>
> Current implementation of
> {{ThreadContextDataInjector.ForDefaultThreadContextMap::injectContextData}}
> always copies all elements from the ThreadContext into the reused StringMap
> of the LogEvent.
> Since the DefaultThreadContextMap is used in web applications (when non-JDK
> thread-locals are not available and Log4j is not garbage-free), we don't need
> to worry about creating additional objects. We can speed up the
> {{injectContextData}} method by wrapping the context data {{Map<String,
> String>}} in a decorator object that implements the {{StringMap}} interface.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]