Unhandled ASP.NET Errors - any logging available?

2019-02-21 13:45发布

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.

3条回答
成全新的幸福
2楼-- · 2019-02-21 14:28

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.

查看更多
孤傲高冷的网名
3楼-- · 2019-02-21 14:31

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/

查看更多
【Aperson】
4楼-- · 2019-02-21 14:40
// 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()
}
查看更多
登录 后发表回答