logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: svn commit: r391905 - in /logging/log4j/trunk: docs/ src/java/org/apache/log4j/ src/java/org/apache/log4j/joran/ src/java/org/apache/log4j/spi/ src/java/org/apache/log4j/watchdog/ src/java/org/apache/log4j/xml/ tests/input/watchdog/ tests/src/java/org/...
Date Thu, 06 Apr 2006 13:33:14 GMT

On Apr 6, 2006, at 12:32 AM, mwomack@apache.org wrote:

> Author: mwomack
> Date: Wed Apr  5 22:32:38 2006
> New Revision: 391905
>
> URL: http://svn.apache.org/viewcvs?rev=391905&view=rev
> Log:

> Cleaned up FileWatchdog implementation, added back  
> configureAndWatch methods for DOMConfigurator and  
> PropertyConfigurator, added more FileWatchdog related tests.
>
....

> URL: http://svn.apache.org/viewcvs/logging/log4j/trunk/src/java/org/ 
> apache/log4j/spi/ConfiguratorEx.java?rev=391905&view=auto
> ====================================================================== 
> ========
> --- logging/log4j/trunk/src/java/org/apache/log4j/spi/ 
> ConfiguratorEx.java (added)
> +++ logging/log4j/trunk/src/java/org/apache/log4j/spi/ 
> ConfiguratorEx.java Wed Apr  5 22:32:38 2006
> @@ -0,0 +1,19 @@
> +package org.apache.log4j.spi;
> +
> +import java.io.InputStream;
> +
> +/**
> + * Defines extended methods for Configurators to implement.
> + *
> + * @author Mark Womack
> + * @since 1.3
> + */
> +public interface ConfiguratorEx {
> +  /**
> +   * Configures using an InputStream for input.
> +   *
> +   * @param stream
> +   * @param repository
> +   */
> +  public void doConfigure(InputStream stream, LoggerRepository  
> repository);
> +}
>


Using an InputStream is a problem since it would cause any XML  
configuration that contained external entities to fail to parse.  For  
example, if you have a document like:

<!DOCTYPE log4j:configuration [
<!ENTITY stdAppenders SYSTEM 'stdAppenders.xml'>
]>
<log4j:configuration>
      <!-- include standard appenders -->
      &stdAppenders;
...
</log4j:configuration>

This document would successfully parse when  
DOMConfigurator.configurator(File) is called but would fail on  
DOMConfigurator(InputStream) since the base path needed to resolve  
the relative file spec stdAppenders.xml is not provided.  From  
reading the code, I believe that configureAndWatch would likely  
succeed on the initial configuration but would fail on any subsequent  
configuration.

Using org.xml.sax.InputSource instead of java.io.InputStream may be  
one way to address the problem.




---------------------------------------------------------------------
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