I have a log4j.properties that sit right under the src folder. When I building my war file using ANT tool, the particular properties file wasn’t pack inside WEB-INF/classes folder, and it was right under the “root” directory of the war file (if you unwar it). I heard from my colleague mention that this is not correct. May I know is this true? If no, how should I correct it?
THanks @!
Yes,
log4j.properties(or any other resource loaded from the classpath) should be at the root of your Java source folder (src/main/java,build/main,src,JavaSource, or however you have your project configured).In the WAR, it should be under
WEB-INF/classes, not at the root (as if you unzipped it).If this is not the case, being able to see your ANT build file would be very helpful. You should have something like this line configured within your
wartask:As long as you have a
build/main/log4j.propertiesin your Ant basedir, this should work as you’re expecting.