logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag Christensen" <Dag.Christen...@vbd.no>
Subject Enabling an appender at run time
Date Thu, 18 May 2006 08:46:43 GMT
 
In my library's log4net setup I have two RollingFileAppenders enabled by
default. If the user logs on to a database (depends on the application),
I want to enable additional AdoNetAppenders with connectionstrings
pointing to the database the user is logged on to (multiple choices).
 
I believe I have three options (?)
 
1. Use a XML file for my RollingFileAppenders, dynamically adding
AdoNetAppenders at runtime (if possible, what happens if the XML file
changes?)
2. Add placeholder AdoNetAppenders to my XML file with threshold = off
and an empty connection string, and set these at runtime? (again, the
XML file can change).
3. If I understand repositories correctly, is the suggested solution to
add a new repository? If so, can I copy my category filters (level per
category) to the new repository?
 
I believe I can use the
log4net.LogManager.GetRepository().ConfigurationChanged event to detect
changes to the XML file, but at this point I've already lost my current
settings?

I'm a bit unsure how to solve this, preferably (I think..) the database
loggers should be kept separate from my XML file, but I want to carry
over the category/log level nodes.

Hope this description was clear enough :-p Any suggestions how to
proceed to solve this ?


Thanks,

Dag Christensen
Vestfold Butikkdata AS
###########################################

This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
For more information, connect to http://www.f-secure.com/

Mime
View raw message