logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jeffrey_chavis" <Jeffrey.cha...@jhuapl.edu>
Subject Re: log4j xml configuration
Date Fri, 03 Oct 2003 19:19:51 GMT
OK, I added a file named log4j.xml to a directory in the classpath 
and this works wonderfully.

The next question is I want to use the PropertyConfigurator to load a 
named config file. When I pass the PropertyConfigurator a non-xml 
file it works, but if I pass it an xml file it does not. Is there 
something I need to do in the PropertConfigurator to get it to load 
an XML file 

Here is the code i use to pass the filename to the 
PropertyConfigurator 

    String userDir = System.getProperty("user.dir","test");
    String fileSeparator = System.getProperty("file.separator");
    String filename = userDir +
                      fileSeparator +
                      "config" +
                      fileSeparator +
                      "Sync_GNCST_Latency_config";

    // use the Property Configurator to configure log file.
    PropertyConfigurator.configure(filename);

Jeff



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Mime
View raw message