logo       

Dynamically changing connection string in XML config file.: msg#00041

log.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





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise