Dario, Thank you for your contribution.
DOMConfigurator is being deprecated in the 1.3 release in favor of a new xml based configurator named JoranConfigurator. So, I don't think we will be applying anymore changes to it going forward. Also, the watchdog mechanism is being expanded and implemented in the new 1.3 Plugin mechanism. You will now be able to use watchdogs with any Configurator without any modification required for the Configurator. And a wider range of watchable source types (file, http, socket) will be implemented as well. Setting up a watchdog will be per repository as you have modified here and you will have better control over when the watchdog starts and stops, something that is a problem with the 1.2.X implementation. If you have any questions or other ideas/contributions, please don't hesitate to post them. It is people like yourself that help this project create useful stuff for all to use. Thanks, -Mark > -----Original Message----- > From: D�rio Lu�s Coneglian Oliveros [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 07, 2005 6:45 AM > To: Log4J Developers List > Subject: configureAndWatch contribution > > Hi all, > > I would like to make a contribution to DOMConfiguration class by > overloading the configureAndWatch method so it can accept a > LoggerRepository as an argument. This is very useful when you have EARs > with different log4j configuration files and want to configure them > dynamically. > > DOMConfigurator.java: > ... > /** > * .... > * @param repository > * A logger repository. > */ > static public void configureAndWatch(String configFilename, long > delay, > LoggerRepository repository) { > XMLWatchdog xdog = new XMLWatchdog(configFilename, repository); > xdog.setDelay(delay); > xdog.start(); > } > ... > class XMLWatchdog extends FileWatchdog { > private LoggerRepository repository = null; > > XMLWatchdog(String filename) { > super(filename); > } > > XMLWatchdog(String filename, LoggerRepository repository) { > super(filename); > this.repository = repository; > } > > /** > Call [EMAIL PROTECTED] PropertyConfigurator#configure(String)} with the > <code>filename</code> to reconfigure log4j. */ > public > void doOnChange() { > if (repository == null) { > new DOMConfigurator().doConfigure(filename, > LogManager.getLoggerRepository()); > } else { > new DOMConfigurator().doConfigure(filename, repository); > } > } > } > > Please let me know your comments. > > Thanks, > Dario Oliveros > > > -----Original Message----- > From: D�rio Lu�s Coneglian Oliveros > Sent: quarta-feira, 23 de mar�o de 2005 18:05 > To: [email protected] > Subject: Contribution to DOMConfigurator > > > Hi there, > > I would like to make a contribution to log4j, but I am not sure how to > proceed. > Basically I would like to overload the configureAndWatch method from > DOMConfigurator to accept a new argument: LoggerRepository. > This issue came up when I decided to have two different configuration > files for two different scoped EARs, which one of them having its own > repository. At first I could get it working, but I was not able to > configure their respective config files dynamically through use of > DOMConfigurator.configureAndWatch(). That�s because the watchdog thread > started by this method always invokes LogManager.getLoggerRepository. > Please let me know any comments or concerns you may have. > > Thanks in advance. > > D�rio Lu�s C. Oliveros > Software Architect > CPqD Telecom & IT Solutions > Tel.: +55 19 3705-4586 / Fax: +55 19 3705-6135 > [EMAIL PROTECTED] > www.cpqd.com.br > > > --------------------------------------------------------------------- > 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
