Exception Log code
Loading
Exception Log code
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Utpal DuttaPosted Oct 5, 2023, 6:28 AM
Exception logs can be handled in multiple way.
1. You can follow traditional way using try-catch block
2. You can handle globally using Exception filter
3. You can handle through middleware also
Sachin SinghPosted Oct 5, 2023, 6:09 AM
I often use NLog, here is an article on NLog
https://codewithmukesh.com/blog/logging-with-nlog-in-aspnet-core/
Vishal YelvePosted Oct 5, 2023, 4:15 AM
Hi,
There are several ways to log exception.
https://www.c-sharpcorner.com/UploadFile/0c1bb2/logging-excetion-to-text-file/
https://www.codeproject.com/Articles/5344667/Logging-with-Serilog-in-ASP-NET-Core-Web-API
https://www.c-sharpcorner.com/article/introduction-to-nlog-with-asp-net-core2/