If using maven, usually you put log4j.properties under java or resources?

user496949 picture user496949 · Feb 27, 2011 · Viewed 137k times · Source

Where should I put the log4j.properties file when using the conventional Maven directories?

Answer

Jan Galinski picture Jan Galinski · Feb 27, 2011

src/main/resources is the "standard placement" for this.

Update: The above answers the question, but its not the best solution. Check out the other answers and the comments on this ... you would probably not shipping your own logging properties with the jar but instead leave it to the client (for example app-server, stage environment, etc) to configure the desired logging. Thus, putting it in src/test/resources is my preferred solution.

Note: Speaking of leaving the concrete log config to the client/user, you should consider replacing log4j with slf4j in your app.