tags:

views:

13

answers:

1

i have created a log4j util class where i'm picking up the 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 anyone tell me where do i place the log4j.xml file?

A: 

Put it on the classpath, in the root folder.

Boris Pavlović
u mean in the src folder..i have tried that...its nt working
AutoMEta
Search where does the build place the .class files. At the root of that folder log4j.xml should be placed, too.
Boris Pavlović
ya..got it...i should have put it to root instead of src folder..thanks
AutoMEta
you are welcome
Boris Pavlović