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.
ELMAH (Error Logging Modules and Handlers) is an error logging facility that you plug into your ASP.NET application as a NuGet package. ELMAH provides the following capabilities: Logging of unhandled exceptions. A web page to view the entire log of recoded unhandled exceptions.
An ExceptionFilterAttribute is used to collect unhandled exceptions. You can register it as a global filter, and it will function as a global exception handler. Another option is to use a custom middleware designed to do nothing but catch unhandled exceptions.
View Unhandled Exceptions in Windows Event Viewer If your application has unhandled exceptions, that may be logged in the Windows Event Viewer under the category of “Application”. This can be helpful if you can't figure out why your application suddenly crashes.
Error handling in ASP.NET has three aspects: Tracing - tracing the program execution at page level or application level. Error handling - handling standard errors or custom errors at page level or application level. Debugging - stepping through the program, setting break points to analyze the code.
You should be able to check the Application Event Viewer.
The assumption here is that it bubbled up and didn't get caught anywhere.
// 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()
}
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With