Hello.  First things first... great work with Log4j.  Also, thank you to
anyone who takes a moment to answer my questions!  Now on to my questions:



I am integrating Log4j into a new project, but have not been able to resolve
an issue by reading the documentation (perhaps I haven't been reading in the
right places).  Does Log4j read the properties file from the hard drive each
and every time I call the following line of code?

     PropertyConfigurator.configure("MyConfigFile.properties");

I am presuming that PropertyConfigurator.configure() needs to be called only
once per thread, then everything is ready.  Do I understand correctly?

Second question:

In the following code, why is it OK for Category.getInstance("my.category");
to precede PropertyConfigurator.configure("MyConfigFile.properties"); ?
Doesn't getInstance() need the config file to be read in first?



import com.foo.Bar;

 import org.apache.log4j.Category;
 import org.apache.log4j.PropertyConfigurator;

 public class MyApp {

   static Category cat = Category.getInstance(MyApp.class.getName());

   public static void main(String[] args) {


     // BasicConfigurator replaced with PropertyConfigurator.
     PropertyConfigurator.configure(args[0]);

     cat.info("Entering application.");
     Bar bar = new Bar();
     bar.doIt();
     cat.info("Exiting application.");
   }
 }



Thanks and regards,
Mark Buscher
[EMAIL PROTECTED]





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

Reply via email to