I already have a db connection string in my web.config file. I scanned the log4net docs, but can\'t seem to find a way to use it within the log4net section of my web.config
Create a class that extends AdoNetAppender
- say, WebAppAdoNetAppender
. Implement the ConnectionString
property in that class, and retrieve the connection string from your web.config file in that property setter.
...
...
public class WebAppAdoNetAppender : log4net.Appender.AdoNetAppender
{
public new string ConnectionString
{
get { return base.ConnectionString; }
set { base.ConnectionString = ... }
}
}