Where to keep log4j.properties in a Maven project?

By default, maven will pull your resources from /src/main/resources folder and put it in web-app/WEB-INF/classes folder. So for web based project the default location of lo4j.properties is /src/main/resources folder.

2 thoughts on “Where to keep log4j.properties in a Maven project?

  1. Chris Mercer

    I only keep a very simple default log4j.properties in the resources folder. I use a ServletContextListener to load up a different log4j.xml that is external to the project and loaded in there. If the external log4j.xml does not exist, I print out a big warning message and the just the log4j.properties.

    Also, make sure that your ServletContextListener is the first listener too.


Leave a Reply

Your email address will not be published. Required fields are marked *