Where to put log4j.properties in GWT web application

I have a log4j.properties and another .properties file under src and it is running in gwt dev mode. To build a war to run in tomcat I am using an ant script that compiles .java classes and puts them in a JAR file. The JAR file is copied to the WEB-INF folder in the war file.

The app works fine when I am not using log4j, but it cannot find the properties file when I try to use log4j. All the answers I see are talking about WEB-INF / classes, but my project does not have a WEB-INF / classes directory, instead the JAR file that was copied to WEB-INF contains my project classes.

+3


source to share


1 answer


You should place the log4j.properties (or log4j.xml) file in a directory or JAR that your servlet container sees as a resource on the Classpath.

So, just create a WEB-INF / classes directory and put it there or pack it in your JAR.



See also Where should I put the log4j.properties file? - this can be helpful.

+4


source







All Articles