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.co
I had problems using log4j with Sun's JDK and automatic configuration.
You can use this:
String filename = System.getProperty("log4j.configuration"); DOMConfigurator(filename);
before using Logger.