Unhandled ASP.NET Errors – any logging available?

We’ve had an issue where a .NET error occured at the root of our application cluster that bypassed our error handling and was displaying the generic ASP.NET error message.

Is there anywhere to check to see these errors if it bypassed our logging of them? (Default .NET/IIS logging or anything?)

Thanks.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

You should be able to check the Application Event Viewer.

  1. Right-click My Computer
  2. Manage
  3. Event Viewer
  4. Application

The assumption here is that it bubbled up and didn’t get caught anywhere.

Method 2

// Inside your logger constructor:
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(AppDomainUnhandledException);

// Then:
private void AppDomainUnhandledException(Object sender, UnhandledExceptionEventArgs e)
{
    // Log as unhandled exception: e.ExceptionObject.ToString()
}

Method 3

If you are using IIS7 you can add failed request tracing via IIS Manager. See the following article for more information:

http://learn.iis.net/page.aspx/266/troubleshooting-failed-requests-using-tracing-in-iis-7/


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x