logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Abramov <dabra...@optonline.net>
Subject Implementing custom log4net.config
Date Sat, 19 Dec 2009 15:39:04 GMT
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

Mime
View raw message