logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: XmlHierarchyConfigurator
Date Fri, 22 Dec 2006 05:17:45 GMT
The call to SetParameter (XmlHierarchyConfigurator.cs:185) in the foreach loop inside the Configure
method could be replaced with a call to ParseUnknownElement:

 protected virtual ParseUnknownElement(XmlElement xmlElement, Hierarchy hierarchy)
  SetParameter(xmlElement, hierarchy);

to match ParseLogger, ParseRenderer, etc. That would allow you do extend XmlHierarchyConfigurator
and do custom processing on user defined top level elements. The default behavior of calling
SetParameter would remain the same.

----- Original Message ----
From: Igor Trofimov <iamhere2@gmail.com>
To: Log4NET User <log4net-user@logging.apache.org>
Sent: Sunday, December 17, 2006 1:37:21 PM
Subject: Re: XmlHierarchyConfigurator

Well, i want to add recognition of my specific elements in hierarchy 
configuration, similar to <logger>.
And this elements can contain <appender-ref> elements (just as logger do) 
with reference to some appender - so, i can't use default capabilities of 
SetParameter - there can't be sutable add-method for "appender-ref".

You wrote to "Log4NET User" <log4net-user@logging.apache.org> on Sun, 17 Dec 
2006 10:02:22 -0800 (PST):

 RG> XmlHierarchyConfigurator seems like a fairly complex class that was
 RG> designed to parse a particular file structure without much thought for
 RG> extensibility (its probably not a good thing to encourage people to use
 RG> their own slightly different configuration file structure). Take the
 RG> SetParameter method for example...making that virtual (~250 lines)
 RG> would allow you to change how parameters are set but my guess is that
 RG> you'd still need to copy and paste a lot of that code to get your
 RG> override to perform similiar to the base method.

 RG> What parts of XmlHierarchyConfigurator do you want to override?

View raw message