/**
   * This method intuits if Log4j got configured correctly by checking if there are
   * Cateogies, and if the Root Category has at least one Appender setup.
   * @return boolean True if Log4j is configured properly.
   */
  private static boolean isLog4jConfigured()
  {
    Enumeration theCats = Category.getCurrentCategories();
    Enumeration theRootAppenders = Category.getRoot().getAllAppenders();
    return ( ( theCats.hasMoreElements() ) || ( !( theRootAppenders instanceof org.apache.log4j.helpers.NullEnumeration ) ) );
  }
-----Original Message-----
From: Pugh, Eric [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 14, 2001 9:08 AM
To: 'LOG4J Users Mailing List'
Subject: Related to Some questions

Hi all,
 
I have a related question.  I have an object that I access via two ways.  This means that the init function is sometimes called twice for the same object.  I call:
PropertyConfigurator.configure(new url(PROP_FILE)) twice therefore, and all my logging is duplicated because I have doubled all my appenders.
 
I could always do PropertyConfigurator.resetConfigruation before hand, but that seems slow.
 
How can I see if I have already called the configure method?
 
Eric
-----Original Message-----
From: Thierry Cools [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 14, 2001 2:23 AM
To: [EMAIL PROTECTED]
Subject: Some questions

Hi, I'm a new user of log4j and I have some questions about this tool.
 
I'd like to use Log4j in an EJB environment that is talking to a web-application.
My question is, how can I initialize Categories and Proterties, using a XML file or a properties file and be sure that those will be accessible as well to the client side as to the server side.
 
Initialization on the client side can be done in the servlet when my web-application start but for the EJB part I don't know what I will access first.
 
Thanks for your help,
Thierry

Thierry Cools
 
Senior Java Developer
S1 Brussels
Kleine Kloosterstraat, 23
1932 st. Stevens-Woluwe
Belgium
Tel : +32 2 200 43 82
Email : [EMAIL PROTECTED]

Reply via email to