How do I get log4j to pick up a properties file.
I\'m writing a Java desktop app which I want to use log4j. In my main method if have this:
Proper
Since JVM arguments are eventually passed to your java program as system variables, you can use this code at the beginning of your execution point to edit the property and have log4j read the property you just set in system properties
try {
System.setProperty("log4j.configuration", new File(System.getProperty("user.dir")+File.separator+"conf"+File.separator+"log4j.properties").toURI().toURL().toString());
} catch (MalformedURLException e) {
e.printStackTrace();
}