External log4j.xml file

Posted by javamonkey79 on Stack Overflow See other posts from Stack Overflow or by javamonkey79
Published on 2010-04-07T17:51:43Z Indexed on 2010/04/07 17:53 UTC
Read the original article Hit count: 359

Filed under:
|
|

I am trying to run a jar with the log4j.xml file on the file system outside the jar like so:

java -jar MyJarName.jar -cp=/opt/companyName/pathToJar/ log4j.configuration=log4j.xml argToJar1 argToJar2

I have also tried:

java -jar MyJarName.jar -cp=/opt/companyName/pathToJar/ log4j.configuration=/opt/companyName/pathToJar/log4j.xml argToJar1 argToJar2

The log4j.xml is file is in the same directory as the jar (/opt/companyName/pathToJar/), yet I still get the standard warning message:

log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle).
log4j:WARN Please initialize the log4j system properly.

Is it possible to have the config file outside the jar, or do I have to package it with the jar?

TIA

© Stack Overflow or respective owner

Related posts about java

Related posts about log4j