I'm working on a `Spring MVC 4.2.5.RELEASE` web application, I'm using `Netbeans` IDE with `GlassFishSErver 4.1`, I want to use `log4j 1.2.17` so I created a log4j.properties file but it seems like my properties file it's not being found because I get the following error:
I configured my Spring application using java annotations here is my configuration
here is my WebInitializer
and here is my controller
and here it's my `log4j.properties`
and I put this log4j.properties in my resources folder, here is my project structure
So I put the log4j.properties in the Other Resources/src/main/resources and when I did this Netbeans created a default Package with the file inside like this default package/log4j-properties and it worked the logs starting to appear in the output and everything worked fine as expected.
I tried to create a package named Log4jResource inside this path src/main/resources but when I did this it stopped to work and the error showed again, so it's there a way to put this file in that folder but without having to use default package that NetBeans creates when I put the folder in there.
I tried doing refactor rename the default package but it shows me this error Module JPA Refactoring threw java.lang.NullPointerException. Please report a bug against JPA Refactoring module and attach your var/log/messages.log.
It would be better if I create that classes folder inside my WEB-INF??
Forget about NetBeans. If maven can create it, then NetBeans should be able to create it.
To ensure that the WEB-INF/classes/log4j.properties file build into its proper home in the target WAR, create a directory /src/main/resources/WEB-INF/classes in your Maven project directory and put the source log4j.property file there. Maven will automatically copy it.
Got idle CPU cycles? Join the war on COVID-19 by donating them to find the coronavirus' weak spots. folding@home Runs in the background. https://foldingathome.org
Well don't expect me to do the dishes! This ad has been cleaned for your convenience: