Log4j.xml file location

I created a log4j util class where I compile a file using

org.apache.log4j.xml.DOMConfigurator.configure("log4j.xml"); 

but when testing it throws

 log4j:ERROR Could not open [log4j.xml]. java.io.FileNotFoundException: log4j.xml (The system cannot find the file specified.) at java.io.FileInputStream.<init>(FileInputStream.java:112) at java.io.FileInputStream.<init>(FileInputStream.java:72) 

Can someone tell me where can I put the log4j.xml file?

+7
logging log4j
source share
1 answer

Put it in the classpath in the root folder.

+7
source share

All Articles