Where should I put the log4j.properties file when using the conventional Maven directories?
Where should I put the log4j.properties file when using the conventional Maven directories?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
src/main/resourcesis 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/resourcesis my preferred solution.Note: Speaking of leaving the concrete log config to the client/user, you should consider replacing
log4jwithslf4jin your app.