You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Gunter Sammet <Gu...@sammet.net> on 2001/09/11 07:34:46 UTC

Strange

Hello all,
had my config file through XML working fine. Added some lines of code (and
later I removed the lines related to log4j init) and now I can't make the
system to find the XML file. Here is the code I use to initialize log4j:

      // Use a PropertyConfigurator to initialize from a property file.
      String parentDir = "..";
      String sep = File.separator;
      String resource = "example.xml"; //me
                          cat.debug("String resource: " + resource);
                          System.out.println("String resource: " +
resource); //TESTLINE
          resource = parentDir + sep + resource;
    	  URL configFileResource =
OccGuiApplication.class.getResource(resource);
if(configFileResource != null) {
	  	  DOMConfigurator.configure(configFileResource.getFile());

When I print out configFileResource it prints:
file:/C:/Documents and
Settings/Administrator/jbproject/occ/classes/example.xml

When I print out configFileResource.getFile() it prints:
/C:/Documents and Settings/Administrator/jbproject/occ/classes/example.xml

I'm sort of spinning my wheels because this doesn't makes much sense to me.
Any input is very much appreciated!!!
TIA Gunter


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