I did a similar thing in a web environment for a FileAppender. 
http://insario.com/blog/jfk/archive/2004/11/30/164.aspx
-Josh

-----Original Message-----
From: Diego Barros [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 10, 2005 9:04 PM
To: Log4NET User
Subject: Dynamically changing connection string in XML config file.

Hello all,

I was wondering whether it was possible to set the ADONetAppender's
connection
string in code when configuring log4net? During testing I have a config
file which had a hard coded connection string for the database
connection.
I would like to modify that just prior to log4net being configured, but
still have the configuration in the XML file. Is this possible?

Where I had:

log4net.Config.DOMConfigurator.Configure(new
System.IO.FileInfo(@"c:\temp\MyApp.conf"));

I would like to have a different connection string for the
ADONetAppender
than what exists in MyApp.conf. Is this possible? Or should I go about
this
another way? The connection string that I need to use may change and
would
be retrieved from another location.

Any help would be appreciated.

Cheers,
Diego


Reply via email to