Database Entry in ASP.NET Core MVC 6

In my old MVC5 project, all the log data was stored in the sql server database via log4net. I would like to keep the ASP.NET 5 log structure without using log4net. Is it possible to save logs in a database table? What code should I use?

+5
source share
2 answers

You can implement ILoggerFactory and ILogger , but you like to include, for example, writing to the database.

Here is an example implementation of ILogger that uses EntityFramework 6 to save logs to a database.

+13
source

I created a new project that is more flexible and affordable for the Entity Framework Core. Here is the GitHub project site:

https://github.com/msmolka/ZNetCS.AspNetCore.Logging.EntityFrameworkCore

+2
source

Source: https://habr.com/ru/post/1238753/


All Articles