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-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org