Is there a way to configure NLog to automatically log all exceptions my application can send? Currently I am going to all TRY/CATCH blocks and manually adding logging in the CAT
For WebApi application you can do this in Global.asax.cs like that
Global.asax.cs
protected void Application_Error() { Exception lastException = Server.GetLastError(); NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger(); logger.Fatal(lastException); }
MSDN resource