indira
indira

Reputation: 83

Specifying log4j.xml as a file

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

Answers (2)

Snovian
Snovian

Reputation: 16

DOMConfigurator.configure("file:///sw/merlot/config/log4j.xml");
Logger log = Logger.getLogger(YourClass.class);

Upvotes: 0

Jigar Joshi
Jigar Joshi

Reputation: 240898

Use

java -Dlog4j.configuration=/home/user/path/to/your/log4j.xml -jar yourJar.jar 

Upvotes: 3

Related Questions