I successfully configured log4j configuration by placing log4j.properties file inside in src/main/webapp/WEB-INF/classes
folder. The logs for the application was working fine but my JUnit test cases logging was not working.
Searched over the internet and found out that I have to place my log4j.properties file inside src/test/resources
for my JUnit test cases logging. Did so and logging for JUnit test cases also started working.
Deployed my application in my server after that and the log4j is now reading log4j.properties file from src/test/resources instead of one from WEB-INF/classes directory (the JUnit log4j.properties file creates a different log file for logging, and the logs are being written in that log file).
The application (maven project and not the war file) is being deployed in my weblogic server inside eclipse.
Please let me know how can i resolve this log4j configuration issue, so that my server uses the correct log4j configuration file.
log4j import:
import org.apache.log4j.Logger;
Logger instantiation:
private static Logger logger = Logger.getLogger(TestClass.class);
maven war:war
! – Grim