rgoers commented on a change in pull request #475:
URL: https://github.com/apache/logging-log4j2/pull/475#discussion_r599073899



##########
File path: 
log4j-slf4j18-impl/src/main/java/org/apache/logging/slf4j/Log4jLoggerFactory.java
##########
@@ -47,8 +47,12 @@ protected Logger newLogger(final String name, final 
LoggerContext context) {
 
     @Override
     protected LoggerContext getContext() {
-        final Class<?> anchor = StackLocatorUtil.getCallerClass(FQCN, PACKAGE);
-        return anchor == null ? LogManager.getContext() : 
getContext(StackLocatorUtil.getCallerClass(anchor));
+        final Class<?> anchor = 
LogManager.getFactory().isClassLoaderDependent()
+                ? StackLocatorUtil.getCallerClass(FQCN, PACKAGE)
+                : null;
+        return anchor == null
+                ? LogManager.getContext()
+                : getContext(StackLocatorUtil.getCallerClass(anchor));

Review comment:
       Yes, the optimization should be done separately. I'm not exactly sure 
what you mean by iterating on this PR. I would suggest merging this one and 
then do the other work as follow-up items later. So long as what you merge 
works we should be fine.




-- 
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]


Reply via email to