7

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 2

14

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.

Sign up to request clarification or add additional context in comments.

7 Comments

Dude! And no license! High five.
@JimYarbro I see most people prefer a license than not - how does none benefit you?
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.
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
Thanks for the clarification guys, I've added an MIT license to the repo.
|
2

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.