You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Remko Popma (JIRA)" <ji...@apache.org> on 2016/09/23 13:57:20 UTC
[jira] [Created] (LOG4J2-1611) Improve performance of
ThreadContextDataInjector.ForDefaultThreadContextMap
Remko Popma created LOG4J2-1611:
-----------------------------------
Summary: 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
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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org