Implement Logging in Sql Server Database using Nlog in .net core MVC application - part 3
In previous article " Implement Logging in CSV file using Nlog in .net core MVC application- part 2 " I have demonstrated that how we can implement Logging in CSV file using Nlog in .core mvc application. In previous article I have logged the exceptions in CSV file, in this article I will show you how you can store the exception and custom logs in SQL server database using Nlog in .net core MVC application. Storing logs in SQL server database can help us to query the exception data efficiently and we can show it to UI if needed to check exception upfront. Lets start the implementation of it, I going to use the same example project used in previous article/demonstration. The following nuget package needs to be installed before implement the sql server logging using NLog. "Microsoft.Data.SqlClient" Version="3.0.1" "NLog" Version="4.7.13" "NLog.Config" Version="4.7.13" "NLog.Extensions.Logging" Versio...