Techspace

IT happens only in IT

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.

June 11, 2010 - Posted by | Maven | , ,

2 Comments »

  1. 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.

    Comment by Chris Mercer | June 11, 2010 | Reply

    • Interesting!

      Comment by Sandeep | June 16, 2010 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.