You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Denis Abramov <da...@optonline.net> on 2009/12/19 16:39:04 UTC

Implementing custom log4net.config

I have a log4net.config file that is custom. For each appender that  
log4net loads I  would like log4net to do a callback to a method of my  
own so I can change the parameters of the appender at runtime i.e.  
replace variables. So a sample appender in my log4bet.config would  
look like:

<appender ...>
    <some-property>${property-key1}</some-property>
</appender>

So at runtime, for example I could look at some table in the database  
knowing the type of appender (from the "type" attribute of the  
appender) and the property (by looking up "property-key") to resolve  
the value. I could then change the appender config that I pass to  
log4net before the appender is instantiated.

I was thinking that I should be using the LoggingRepositorySkeleton  
for this but can't find any examples of how to use it. Any pointers,  
examples on how to tackle this problem?



Sincerely,
Denis Abramov
daa82_at_columbia_dot_edu