I'm new to log4net and was given a task to Switch the way log4net gets the connectionstring.
The connectionstring may be different for different groups of people who visits the site. i.e. company A has users who use the site and has its own db and therefore has its own logging table which log4net uses.
We were currently using a connection string in a webconfig file.
I created this code but doesn't work
MyNamspace
{
public class Log4NetAdoNetAppender :log4net.Appender.AdoNetAppender
{
public new string ConnectionString
{
get { return base.ConnectionString; }
set
{
base.ConnectionString = Service.GetConnectionString();
}
}
}
}
<appender name="ADONetAppender" type="MyNamspace.Log4NetAdoNetAppender">
I think you could:
Hope it helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With