In my old MVC5 project all log informations was saved on a sql server database through log4net. I would like keep logger structure of ASP.NET 5 without using any more the log4net. Is it possibile saving the logs on a database table? What kind of code should I use?
The NLog. Web. AspNetCore-package supports the platforms: For ASP.NET Core 6, .
You can implement ILoggerFactory
and ILogger
however you like including, for example, logging to a database.
Here's an example of an ILogger
implementation that uses EntityFramework 6 to save logs to a database.
I've created new project that is a bit more flexible and available for Entity Framework Core. Here is the GitHub project site:
https://github.com/msmolka/ZNetCS.AspNetCore.Logging.EntityFrameworkCore
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