ClassLoaderContextSelector
should create a separate context per classloader
#2314
Labels
bug
Incorrect, unexpected, or unintended behavior of existing code
The
ClassLoaderContextSelector#locateContext
currently implements the following logic:logging-log4j2/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java
Lines 189 to 221 in f05864d
If the initial
ContextSelector#getContext
call does not provide aconfigLocation
parameter and there is already a logger context associated to an ancestor of theloader
classloader, no new context is created and the logger context of the ancestor is returned.While this might be a feature to minimize the number of logger contexts, IMHO it should be optional and the default behavior should be to create a different logger context per classloader.
This behavior causes #1430 and the problems in #2311.
The text was updated successfully, but these errors were encountered: