Be sure to check out Part 1 as this post builds upon it and the two go hand in hand. Series Overview Part 1 – Setting up logging with ASP.NET MVC, NLog and SQL Server Part 2 – Unhandled exception processing, building an error report, emailing errors, and custom error pages. Custom Error Handling Attribute…
ASP.NET NLog Sql Server Logging and Error Handling Part 1
It was the eleventh hour before a web app was to go live and there was nothing in place for error handling or logging. You’re shocked I’m sure (that’s my sarcastic voice). Normally with web apps in the past I’ve used ELMAH for unhandled error logging and NLog with text file targets for other logging.…
Quick NLog Tip: Getting the Log Filename
I have found NLog to be very easy to use but one thing that was not clear was how to retrieve a log’s filename. Our unhandled exception process packages up different files into a zip file for support and I wanted to resolve the log filename to include it in the package. The below code…
Ninject and NLog with Multiple Loggers
Today I wanted to add some simple file logging to my ASP.NET MVC application and I thought it would be a good time to try out NLog. I used log4net in the past but it has become stale and NLog appeared more modern and capable. I liked what I saw with NLog but I wanted…