Take a
look at the properties "log4j.configuration" and "log4j.configuratorClass".
There's a bit of information in the short manual
http://jakarta.apache.org/log4j/docs/manual.html (where
it uses them to set of Tomcat options).
Then
using something like this:
java -Dlog4j.configuration="log4.xml"
-Dlog4j.configuratorClass=au.com.foo.util.log.ConfigureAndWatchConfigurator
Something like the following works for me:
...
public
class ConfigureAndWatchConfigurator implements Configurator
{
public void doConfigure(URL url, LoggerRepository repository) {
long watchDelaySeconds = 30;
DOMConfigurator.configureAndWatch(url.getPath(), watchDelaySeconds * 1000);
public void doConfigure(URL url, LoggerRepository repository) {
long watchDelaySeconds = 30;
DOMConfigurator.configureAndWatch(url.getPath(), watchDelaySeconds * 1000);
org.apache.log4j.Logger logger
=
org.apache.log4j.Logger.getLogger(getClass());
logger.info("log4j configured using " + url);
logger.info("log4j watch-delay is " + watchDelaySeconds + "s");
logger.info("log4j configured using " + url);
logger.info("log4j watch-delay is " + watchDelaySeconds + "s");
}
}
}
Steve.
-----Original Message-----
From: Rajat Sharma [mailto:[EMAIL PROTECTED]
Sent: Saturday, 30 August 2003 3:27 AM
To: [EMAIL PROTECTED]
Subject: ConfigureAndWatch with WebworkHiI've just started using Log4J and had a couple of doubts about how to set it up for a web-based application that uses Webwork.1. Since Webwork configures log4j to use Configure, is there any way that can be changed to ConfigureAndWatch, without going into Webwork code.2. Since there are multiple entry-points for the application, where should I specify the Configurator details (essentially, the ConfigureAndWatch method call)thanks a lotRajat.
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
