Worked like a charm, thanks!

Eric Bergemann
Software Engineer
Paragon Application Systems, Inc.
326 Raleigh Street
Holly Springs, NC 27540
[EMAIL PROTECTED]
(919) 567-9890
 

-----Original Message-----
From: Ron Grabowski [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 17, 2007 5:53 PM
To: Log4NET User
Subject: Re: AdoNetAppender Connection String from App Config

This patch allows the connection string to come from the App.Config's
connectionStrings section:

http://issues.apache.org/jira/browse/LOG4NET-88

It will most likely make it into the next release. I need to contact Phil
and make him re-upload the files with the appropriate radio button for
Apache inclusion selected.

You could write your own AppSettings ConnectionString AdoNetAppender:

public class AppSettingsConnectionStringAdoNetAppender : AdoNetAppender
{
 public new string ConnectionString
 {
  get { return base.ConnectionString; }
  set { base.ConnectionString = ConfigurationSettings.AppSettings[value]; }
 }
}


----- Original Message ----

From: "Bergemann, Eric" <[EMAIL PROTECTED]>

To: [email protected]

Sent: Wednesday, January 17, 2007 10:15:45 AM

Subject: AdoNetAppender Connection String from App Config



Hi All,

     

   I am trying to pull the configuration for the connection string of an
ADONetAppender outside of the log4net configuration information. Is there
any way that I can update my AdoNetAppender with a new connection string
after using the XmlConfigurator to load the configuration?

     

   Since I already have connection strings that need to be populated for
Castle, ASP.NET memberships as well as log4net I really need my connection
string information consolidated into one location and inside the log4net tag
will not work.

     

   It would be nice if I could put something like ${log4netconnstring} in
place of the connection string for my AdoNetAppender and the configurator
will then know to pull the connection string from the "log4netconnstring"
application setting instead.

     

   Eric Bergemann

   Software Engineer

   Paragon Application Systems, Inc.

   326 Raleigh   Street

   Holly  Springs, NC 27540

   [EMAIL PROTECTED]

   (919) 567-9890

    

     

   

  






Reply via email to