Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the ASP.NET Yellow Screen of Death (YSOD) be generated on demand or captured?

We'd like to just capture the YSOD output to use in an erorr reporting email, from a Global.asax error handler, for instance. Is there any way of leveraging the built-in ysod generator?

like image 367
nicknystrom Avatar asked May 18 '09 16:05

nicknystrom


1 Answers

I would look into ELMAH (Error Logging Modules and Handlers for ASP.NET):

ELMAH (Error Logging Modules and Handlers) is an application-wide error logging facility that is completely pluggable. It can be dynamically added to a running ASP.NET web application, or even all ASP.NET web applications on a machine, without any need for re-compilation or re-deployment.

Once ELMAH has been dropped into a running web application and configured appropriately, you get the following facilities without changing a single line of your code:

  • Logging of nearly all unhandled exceptions.
  • A web page to remotely view the entire log of recoded exceptions.
  • A web page to remotely view the full details of any one logged exception.
  • In many cases, you can review the original yellow screen of death that ASP.NET generated for a given exception, even with customErrors mode turned off.
  • An e-mail notification of each error at the time it occurs.
  • An RSS feed of the last 15 errors from the log.
like image 62
Andrew Hare Avatar answered Sep 18 '22 23:09

Andrew Hare