You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Jeffrey Bonevich <bo...@telocity.com> on 2001/04/15 05:39:04 UTC

[PATCH] Add configure with URL arg to DOMConfigurator

While working with DOMConfigurator a bit, I noticed that there is only a
single static configure method that takes a String argument, a local
file system path.  I am under a mandate to not rely on local filesystems
but rather use ClassLoader resources, i.e. URL.  There is a doConfigure
method that takes an URL, so I have added its corresponding static
configure(URL url) method which calls it.  See attached cvs diff.  Let
me know if any additional info is needed, etc.  Thanx!

jeff

-- 
Jeffrey & Nikole Bonevich
Maxmillian Bonevich
Ann Arbor, Michigan
bonevich@telocity.com
http://www.bonevich.com

Re: [PATCH] Add configure with URL arg to DOMConfigurator

Posted by Ceki Gülcü <cg...@qos.ch>.
Most reasonable patch. I just added it to DOMConfigurator. Ceki

At 22:32 19.05.2001 -0400, you wrote:
><pester>Submitted this a month ago.  Have not heard if it is
>acceptable.  Please respond.</pester>
>
>jeff
>
>Jeffrey Bonevich wrote:
>> 
>> While working with DOMConfigurator a bit, I noticed that there is only a
>> single static configure method that takes a String argument, a local
>> file system path.  I am under a mandate to not rely on local filesystems
>> but rather use ClassLoader resources, i.e. URL.  There is a doConfigure
>> method that takes an URL, so I have added its corresponding static
>> configure(URL url) method which calls it.  See attached cvs diff.  Let
>> me know if any additional info is needed, etc.  Thanx!
>> 
>> jeff
>> 
>> --
>> Jeffrey & Nikole Bonevich
>> Maxmillian Bonevich
>> Ann Arbor, Michigan
>> bonevich@telocity.com
>> http://www.bonevich.com
>> 
>>   ------------------------------------------------------------------------
>> Index: xml/DOMConfigurator.java
>> ===================================================================
>> RCS file: /home/cvspublic/jakarta-log4j/src/java/org/apache/log4j/xml/DOMConfigurator.java,v
>> retrieving revision 1.13
>> diff -u -r1.13 DOMConfigurator.java
>> --- xml/DOMConfigurator.java    2001/04/13 00:01:18     1.13
>> +++ xml/DOMConfigurator.java    2001/04/15 03:27:25
>> @@ -586,6 +586,15 @@
>>    }
>> 
>>    /**
>> +     This is the static version of {@link #doConfigure(URL, Hierarchy)}.x
>> +   */
>> +  static
>> +  public
>> +  void configure(URL url) throws FactoryConfigurationError {
>> +    new DOMConfigurator().doConfigure(url, Category.getDefaultHierarchy());
>> +  }
>> +
>> +  /**
>>       Used internally to configure the log4j framework by parsing a DOM
>>       tree of XML elements based on <a
>>       href="doc-files/log4j.dtd">log4j.dtd</a>.
>> 
>>   ------------------------------------------------------------------------
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: log4j-dev-help@jakarta.apache.org
>
>-- 
>Jeffrey Bonevich
>Ann Arbor, Michigan
>bonevich@telocity.com
>http://www.bonevich.com
>
>Hwæt! Wë Gär-Dena   in geär-dagum,
>peod-cyninga,       prym gefrünon,
>hü ða aepelingas   ellen fremedon!
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-dev-help@jakarta.apache.org

--
Ceki Gülcü


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


Re: [PATCH] Add configure with URL arg to DOMConfigurator

Posted by Jeffrey Bonevich <bo...@telocity.com>.
<pester>Submitted this a month ago.  Have not heard if it is
acceptable.  Please respond.</pester>

jeff

Jeffrey Bonevich wrote:
> 
> While working with DOMConfigurator a bit, I noticed that there is only a
> single static configure method that takes a String argument, a local
> file system path.  I am under a mandate to not rely on local filesystems
> but rather use ClassLoader resources, i.e. URL.  There is a doConfigure
> method that takes an URL, so I have added its corresponding static
> configure(URL url) method which calls it.  See attached cvs diff.  Let
> me know if any additional info is needed, etc.  Thanx!
> 
> jeff
> 
> --
> Jeffrey & Nikole Bonevich
> Maxmillian Bonevich
> Ann Arbor, Michigan
> bonevich@telocity.com
> http://www.bonevich.com
> 
>   ------------------------------------------------------------------------
> Index: xml/DOMConfigurator.java
> ===================================================================
> RCS file: /home/cvspublic/jakarta-log4j/src/java/org/apache/log4j/xml/DOMConfigurator.java,v
> retrieving revision 1.13
> diff -u -r1.13 DOMConfigurator.java
> --- xml/DOMConfigurator.java    2001/04/13 00:01:18     1.13
> +++ xml/DOMConfigurator.java    2001/04/15 03:27:25
> @@ -586,6 +586,15 @@
>    }
> 
>    /**
> +     This is the static version of {@link #doConfigure(URL, Hierarchy)}.x
> +   */
> +  static
> +  public
> +  void configure(URL url) throws FactoryConfigurationError {
> +    new DOMConfigurator().doConfigure(url, Category.getDefaultHierarchy());
> +  }
> +
> +  /**
>       Used internally to configure the log4j framework by parsing a DOM
>       tree of XML elements based on <a
>       href="doc-files/log4j.dtd">log4j.dtd</a>.
> 
>   ------------------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-dev-help@jakarta.apache.org

-- 
Jeffrey Bonevich
Ann Arbor, Michigan
bonevich@telocity.com
http://www.bonevich.com

Hwæt! Wë Gär-Dena   in geär-dagum,
peod-cyninga,       prym gefrünon,
hü ða aepelingas   ellen fremedon!

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