https://bz.apache.org/bugzilla/show_bug.cgi?id=66406
--- Comment #3 from Piotr P. Karwasz <pkarw...@apache.org> ---
Hi Mark,

(In reply to Mark Thomas from comment #2)
> The description in comment #1 of how the handlers are configured does not
> match what I see with the current code.

I was referring to this snippet of code, that deals with the case, where the
application's classloader does not contain a `logging.properties` resource:

        if (is == null) {
            // Retrieve the root logger of the parent classloader instead
            ClassLoader current = classLoader.getParent();
            ClassLoaderLogInfo info = null;
            while (current != null && info == null) {
                info = getClassLoaderInfo(current);
                current = current.getParent();
            }
            if (info != null) {
                localRootLogger.setParent(info.rootNode.logger);
            }
        }

https://github.com/apache/tomcat/blob/bb81a2cf7abf2384e73bdac0313731b8963b9b66/java/org/apache/juli/ClassLoaderLogManager.java#L496

I believe that the reporter's main problem isn't having multiple loggers with
the same name, but having a root logger that has a parent. That is the reason
the code that removes all root handlers and replaces them with a
Log4jBridgeHandler does not work:
https://issues.apache.org/jira/browse/LOG4J2-3646

We can probably greatly reduce the `if` clause above, by ensuring that a
`logging.properties` file is always found.

There are however implications to such a change: Spring Boot uses heuristic to
decide whether or not install a Slf4jBridgeHandler. IIRC the current version
checks if the root logger has a single Console handler. In the current Tomcat
JULI version the root logger of a web app has no handlers, if we make the
change above, it will have all the handlers from the standard Catalina
`logging.properties`.

https://github.com/spring-projects/spring-boot/issues/8933

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to