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?
2 Answers
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.
7 Comments
Jim Yarbro
Dude! And no license! High five.
Stafford Williams
@JimYarbro I see most people prefer a license than not - how does none benefit you?
Jim Yarbro
I actually prefer a license as well, if only so I know what your preferences are. When I see no license, I assume the fundamentals of the MIT license and I just leave attribution files in my solutions when I use other people's code.
Nick
Just a warning, having no licence is actually more restrictive as it implies standard copyright applies. Github is a little different, but I suggest you read their FAQ - help.github.com/articles/open-source-licensing
Stafford Williams
Thanks for the clarification guys, I've added an MIT license to the repo.
|
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