logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Womack <wom...@adobe.com>
Subject RE: configureAndWatch contribution
Date Thu, 07 Apr 2005 20:04:21 GMT
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:oliveros@cpqd.com.br]
> 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 {@link 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: log4j-dev@logging.apache.org
> 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
> oliveros@cpqd.com.br
> www.cpqd.com.br
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message