carterkozak commented on a change in pull request #289: LOG4J2-2644 - Improve
performance of getting location info
URL: https://github.com/apache/logging-log4j2/pull/289#discussion_r299081942
##########
File path:
log4j-api-java9/src/main/java/org/apache/logging/log4j/util/StackLocator.java
##########
@@ -31,6 +33,7 @@
private final static StackLocator INSTANCE = new StackLocator();
+ private final static ThreadLocal<FqcnCallerLocator> LOCATOR =
ThreadLocal.withInitial(FqcnCallerLocator::new);
Review comment:
See `org.apache.logging.log4j.core.util.Constants.ENABLE_THREADLOCALS` and
`org.apache.logging.log4j.util.Constants.ENABLE_THREADLOCALS`.
I think we disable most threadlocals in web-apps to avoid N tomcat webapps
leaving thread-local state on each webserver thread. If memory serves, a
ThreadLocal of a type from the standard library can be shared between all
threads, even if they have loaded different log4j jars, but I'm having trouble
finding the comment where I read that.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services