hi mike,

this is the way you can get the propertys relative, assuming your package is
com.lufthansatechnik.cws.more and your properties are located there:

String configPath = "com/lufthansatechnik/cws/more/log4j.properties";
    try{
      InputStream inputStream =
java.lang.ClassLoader.getSystemResourceAsStream(configPath);
      if(inputStream != null){
        log4jProperties.load(inputStream);
        inputStream.close();
      }
    }catch(java.io.IOException io){
      io.printStackTrace();
    }

now you have the properties needed in the variable log4jproperties and can
use it as follows:

PropertyConfigurator.configure(log4jProperties);

hope this helps,
 oliver


-----Original Message-----
From: Mike Hurd [mailto:[EMAIL PROTECTED]]
Sent: Montag, 11. Juni 2001 11:57
To: LOG4J Users Mailing List
Subject: Configuring Log4Jj from a ResourceBundle


Hi all,
        I've recently started using Log4J to replace our current logging
system and
I'm trying to configure the system using the PropertyConfigurator but need a
way to configure from a properties file without having to have a full path
to that file. The other properties files we use are loaded as
ResourceBundles which means we can address them with a local name i.e.
"VoxSurf.VxsEnvironment" rather than having to explicitly have the file path
(which would change depending on the install). Is there anyway of using a
ResourceBundle to configure Log4J (I can't see a way) and if not whether
this is a  possible addition to a future release?

kind regards,

Mike Hurd
VoxSurf LTD


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to