Created
July 8, 2017 07:23
-
-
Save Hameds/6373afcae7d2d317aa16db4d2ca8f524 to your computer and use it in GitHub Desktop.
automatically log unhandled exceptions in ASP.NET project using NLog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void Application_Error() | |
{ | |
Exception lastException = Server.GetLastError(); | |
NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger(); | |
logger.Fatal(lastException); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment