I'm trying to run mvn exec:java .....
then it uses the runtime classpath defined by my pom, which I think defaults to the compile classpath. the problem is that I found that my src/main/resources/log4j.xml is not reflected, since I put DEBUG logging in the file, but I only see WARN in the output. I suspect that it's actually the log4j.xml from some of the dependency jars that is being used. so I need to elevate the src/main/resources/log4j.xml to the front of my compile/runtime classpath. but how do I specify the relative order of src/main/resources vs dependency jars in the classpath?
Thanks Yang
One workaround is to explicitly specify the log4j.xml that you want log4j to use using a command-line argument.
-Dlog4j.configuration=file:/log4j.xml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With