How to log to database using the built-in Asp.Net core logging (Microsoft.Extensions.Logging)? -
i have following code set logging database using nlog. use alpha version of nlog.extension.logging. possible let built-in log framework log database don't need 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 project on github flexible , available ef core:
znetcs.aspnetcore.logging.entityframeworkcore
it prepared use in asp net core application, not contain references prevents use in plain .net core application. there possibilty extend base log class.
Comments
Post a Comment