On Apr 6, 2006, at 12:32 AM, [EMAIL PROTECTED] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]