8

Earlier today we experienced a YSOD on one of our MVC sites running on IIS on Windows Server 2003.

Usually, these are reported via e-mail using ELMAH (using this setup), but since this was a compilation issue (of some sort), it did not get reported via e-mail.

The specific error was:

"The directory 'App_GlobalResources' is not allowed because the application is precompiled."

This is a major problem, since a potential customer could notice the problem before we do. How can we make sure these YSODs are logged, when the exception handler on the site is not called?

Community
  • 1
  • 1
mbp
  • 1,255
  • 14
  • 29
  • Great question. If things die very early in an app it is hard to even try to log. Looking forward to what others have to say. – Joshua Hudson Aug 27 '09 at 17:07

2 Answers2

4

If you can, check the event viewer on that machine. This is the logger of last resort on a Windows machine.

Andrew Hare
  • 344,730
  • 71
  • 640
  • 635
  • The event viewer had it logged. Can we easily report these events via e-mail? – mbp Aug 27 '09 at 17:07
  • 1
    You can but I don't have any experience doing so. You will need to write a custom solution or use a monitoring tool to accomplish this. Perhaps the folks over at http://serverfault.com will be able to help you with this part. – Andrew Hare Aug 27 '09 at 17:16
4

It is possible to monitor the event log with VBScript. You could then email this when it occurs:

Here's an example:

http://www.microsoft.com/technet/scriptcenter/resources/qanda/feb07/hey0226.mspx and email from vbscript: http://www.paulsadowski.com/WSH/cdo.htm

You could do this with powershell and/or another .net app on the box also.

Kevin LaBranche
  • 20,908
  • 5
  • 52
  • 76
  • Thanks. I found this serverfault question helpful as well: http://serverfault.com/questions/47953/windows-event-log-email-notification – mbp Aug 27 '09 at 18:12