I'm implementing log4net AdoNetAppender in asp.net core 2.0, but I guess it is not supporting. I have implemented log4net RollingFileAppender in core 2.0 & it worked successfully using log4.net config. So, if log4net AdoNetAppender is not supporting in core 2.0, is there any other way to insert logs to sql database in core 2.0?
Thank you
I had the same problem. I've fixed it in the following way:
Add log4net.config.xml file to the ASP.NET Core project with appenders. In this file for AdoNetAppender you can specify
connectionStringorconnectionStringNamebut it doesn't make sense because the connection will benull.So, add connection string to appsettings.json instead
Then configure
and assign connection string manually
The
ActivateOptions()calls for reinitialize the appender.