Fix log4j2 indy plugin context issues
By calling classLoader.getParent() log4j tries to determine the logging context of a class loader
The IndyPluginClassLoader, having a MultipleParentClassLoader as it's parent, always retured null,
making it impossible to reuse context from the agent classloader
@@ -40,7 +40,7 @@ import java.util.Map;
*/
public class IndyPluginClassLoader extends ByteArrayClassLoader.ChildFirst {
public IndyPluginClassLoader(@Nullable ClassLoader targetClassLoader, ClassLoader agentClassLoader, Map<String, byte[]> typeDefinitions) {
- super(new MultipleParentClassLoader(Arrays.asList(agentClassLoader, targetClassLoader)), true, typeDefinitions, PersistenceHandler.MANIFEST);
+ super(new MultipleParentClassLoader(agentClassLoader, Arrays.asList(agentClassLoader, targetClassLoader)), true, typeDefinitions, PersistenceHandler.MANIFEST);
}
@Override
