Thanks Martijn. I think the only way is if I use my implementation for that. But it is more practical to be in that way because nowadays in many java technologies it's been implemented in that way for example Spring. I define in this way.
But log4j will look for the log4j.properties file in the classpath anyway, without you having to do anything at all. I don't see any benefit in what you're asking for there, just so you can put the file in a different directory. You don't even need an init-param if you allow log4j to work in the normal way.
Joined: Aug 16, 2007
Paul, I tried putting the log4j.properties file into classpath i.e. under classes folder and pass only the file name like,
But it doesn't work. So how do you suggest it?