I have the following code to set up logging to database using NLog. I use an Alpha version of NLog.Extension.Logging. Is it possible to let the built-in log framework log to database so I don't need to use NLog?
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
loggerFactory.AddNLog();
env.ConfigureNLog("nlog.config");
app.UseApplicationInsightsRequestTelemetry();
app.UseApplicationInsightsExceptionTelemetry();
app.UseMvc();
}
There is a NuGet package for that (DISCLAIMER: I made it): https://www.nuget.org/packages/DLogger.Extensions.Logging
The GitHub repository: https://github.com/SasaCetkovic/DLogger.Extensions.Logging