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 Joel Trunick <jo...@calebtech.com> on 2001/01/10 17:41:23 UTC
XML Configuration File - Enhancement suggestion
I like the ability to configure Log4j with an XML file as this is how we do
the rest of our deployed application configurations (thru XML). However,
Log4j XML configuration doesn't quite fit into the "spirit of XML" it seems.
I would like to be able to have a little more flexibility in specifying the
Log4j configuration.
Right now my application config file looks like this:
<ComponentCfg1>
Component1 Cfg stuff...
</ComponentCfg1>
<ComponentCfg2>
Component2 Cfg stuff...
</ComponentCfg2>
I would like to add:
<LogCfg>
Log4j configuration stuff...
</LogCfg>
However, I am stuck with the <configuration> name scheme as chosen by Log4j.
I would like to be able to either:
1) Have Log4j "trust" the element I pass in to be parsed (ie.
DOMConfigurator.configure( element ) should not check to see if the element
name is "configure". --or--
2) Be able to change the name of the <configuration> tag (in this case to
<LogCfg>) (ie. setConfigurationTag(String)). This lets me fit it into my XML
schema cleaner. --or--
3) Access the value of CONFIGURATION_TAG (as stored in DOMConfigurator), it
is currently only package scope. This would at least not make me hardcode
"configuration" to find the log4j config stuff in my own file. I could just
wrapper <configuration> with my own tag (ie.
<LogCfg><configuration></configuration></LogCfg>
This is only a slight nit with Log4j, but would help make my stuff just a
little cleaner.
Thanks,
Joel
Re: XML Configuration File - Enhancement suggestion
Posted by Jeff Turner <je...@socialchange.net.au>.
On Thu, 11 Jan 2001 03:41, Joel Trunick wrote:
> I like the ability to configure Log4j with an XML file as this is how we do
> the rest of our deployed application configurations (thru XML). However,
> Log4j XML configuration doesn't quite fit into the "spirit of XML" it
> seems. I would like to be able to have a little more flexibility in
> specifying the Log4j configuration.
>
> Right now my application config file looks like this:
>
> <ComponentCfg1>
> Component1 Cfg stuff...
> </ComponentCfg1>
> <ComponentCfg2>
> Component2 Cfg stuff...
> </ComponentCfg2>
>
> I would like to add:
> <LogCfg>
> Log4j configuration stuff...
> </LogCfg>
I think "architectural forms", ie XAF
(http://www.megginson.com/XAF/home.html) would be useful for this sort of
thing. It's implemented as a SAX driver, and does translation between one set
of tags and another.
I've never used it, so take this with a grain of salt.
--Jeff
>
> However, I am stuck with the <configuration> name scheme as chosen by
> Log4j. I would like to be able to either:
>
> 1) Have Log4j "trust" the element I pass in to be parsed (ie.
> DOMConfigurator.configure( element ) should not check to see if the element
> name is "configure". --or--
>
> 2) Be able to change the name of the <configuration> tag (in this case to
> <LogCfg>) (ie. setConfigurationTag(String)). This lets me fit it into my
> XML schema cleaner. --or--
>
> 3) Access the value of CONFIGURATION_TAG (as stored in DOMConfigurator), it
> is currently only package scope. This would at least not make me hardcode
> "configuration" to find the log4j config stuff in my own file. I could just
> wrapper <configuration> with my own tag (ie.
> <LogCfg><configuration></configuration></LogCfg>
>
> This is only a slight nit with Log4j, but would help make my stuff just a
> little cleaner.
>
> Thanks,
> Joel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-dev-help@jakarta.apache.org