Reputation: 83
When i specified the path of the file, i.e file:///sw/merlot/config/log4j.xml
(this is not in a jar), its not taking log4j.xml
from that path, instead it's taking the default log4j.xml
stored in a jar.
How can i specify that path so that it takes log4j.xml
from the specified path, instead taking it from a jar?
Upvotes: 1
Views: 3123
Reputation: 16
DOMConfigurator.configure("file:///sw/merlot/config/log4j.xml");
Logger log = Logger.getLogger(YourClass.class);
Upvotes: 0
Reputation: 240898
Use
java -Dlog4j.configuration=/home/user/path/to/your/log4j.xml -jar yourJar.jar
Upvotes: 3