You have to invoke the DOMConfigurator.configure method instead of the PropertyConfigurator one.
URL log4jURL = null; try { log4jURL = getServletContext().getResource("/" + configPath); } catch (MalformedURLException murle) { //ignore...we check for null later } if (log4jURL != null) { DOMConfigurator.configure(log4jURL); } jeffrey_chavis writes: > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -------------------------------------------------------------------------------- Get your free 15 Mb POP3 email @alexandria.cc Click here -> http://www.alexandria.cc/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]