Is it possible that log4j.xml is loaded from a source other than the original root, and how? (programmatically?) Meaning that it is somewhere in the FS, not only in the classpath.
Using the DOMConfigurator , you can specify the XML file used to configure log4j.
DOMConfigurator.configure("/path/to/log4j.xml");
For log4j.properties you can do the same with PropertyConfigurator .
PropertyConfigurator.configure("/path/to/log4j.properties");
This may not be the best way, but you can specify the location of the file by setting the java property log4j.configuration = path / to / config / file. For example, you can specify this directly in a java command using java -Dlog4j.configuration=path .
java -Dlog4j.configuration=path