In my case the solution was easy. You don't need to declare anything in your web.xml
.
Because your project is a web application, the config file should be on WEB-INF/classes
after deployment.
I advise you to create a Java resource folder (src/main/resources
) to do that (best pratice). Another approach is to put the config file in your src/main/java
.
Beware with the configuration file name. If you are using XML, the file name is log4j.xml
, otherwise log4j.properties
.