Re: Setting the configuration in classes that don't contain a main().
Posted By:
Mark_Womack
Posted On:
Friday, January 3, 2003 04:57 PM
You can look to using the default initialization procedure provided by log4j. You can find a description of it in this url:
http://jakarta.apache.org/log4j/docs/manual.html
Search for "default initialization". Unfortunately, there is no way to do a configureAndWatch() using this method in v1.2.7. We are looking to add a "watchdog" capability to v1.3 that will be configurable from a configuration file.
It is probably dangerous to do it the way you have above, in a static block. You will need to guarantee that there is just one static block that does the above code.
-Mark