You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Mark Womack <mw...@bevocal.com> on 2001/08/14 19:55:59 UTC

[PATCH] DOMConfigurator.java

Enclosed is a modified version of DOMConfigurator.java, based on the current
CVS version 1.27.  This modified version supports java.io.Reader objects in
the method doConfigure(), instead of only InputStream.
org.xml.sax.InputSource supports a constructor which takes a Reader object,
so the change is very simple:

- modified the existing doConfigure(InputStream, Hierarchy) method to
doConfigure(InputSource, Hierarchy) and made it protected instead of public.
- created a new public version of doConfigure(InputStream,Hierarchy) which
calls doConfigure(InputSource, Hierarchy).
- created a new public method, doConfigure(Reader, Hierarchy), which calls
doConfigure(InputSource, Hierarchy).

That's it.  I needed this modification because I have a case where the xml
configuration data is coming from a string, not a file.  So I need to use
the java.io.StringReader class to wrap the existing string.

I would appreciate it if someone on the ant-dev mailing list could evaluate
and submit this change for inclusion in the next version of log4j.

If you have any questions or concerns, please contact me.

Thanks,
-Mark