You could store it in some configuration file as name=value pair (the
location of which is fixed), read it in as a Java Properties
object, then call Property.configureAndWatch with those arguments.
We do this with Weblogic using the weblogic.properties file.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 26, 2001 5:31 PM
To: [EMAIL PROTECTED]
Subject: How to get the property file?


Hello

Another newbie question.
I need to use dynamic property file, that is i need my code to detect the
changes in log4j.properties and update itself without me restarting it (my
code must run 24 by 7). With the help from this list i did the following

static Category category = Category.getInstance(cat_name);

main ()
{
PropertyConfigurator.configureAndWatch("conf/log4j.properties", 1000);
}

and it works. Unfortunately, all the property files need to be in the conf
directory. Since my conf directory is in my classpath,
Category.getInstance() will find it. But for
PropertyConfigurator.configureAndWatch() i need to specify the whole path,
since (by trial and looking in the code) it takes the filename relative to
the running directory. 
Is there a way for me to use log4j api and get the whole path, instead of
hardcoding it, since i want to be very flexible and do not want to recompile
all the code if location of my property files would change.

thank you
boris

---------------------------------------------------------------------
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