IT:AD:Elmah:HowTo
- See also:
Summary
Error Logging Modules And Handlers (ELMAH).
- ELMAH doesn't change the error experience (still see “Server Error”, etc.)
- ELMAH behind the scenes uses a HttpModule to trap unhandled exceptions:
protected virtual void OnError(object sender, EventArgs args) { var app = (HttpApplication)sender); Log(app.Server.GetLastError(), app.Context); }
- Makes it available to be seen as a webpage (
/corp.com/site/elmah.axh
)
- Comprised of:
- An HTTP module subsystem
- records the messsages to an error logging subsystem
- An HTTP handler subsystem
- retrieves messages from the error logging subsystem
ACiD
- Advantages:
- Surfaces errors to a webpage, so that you don't need to crack open the Event Log Viewer.
- Considerations:
- You have configure it to limit it to authorized people.
- Important: WCF exception are intercepted by ASP.NET and a SOAP fault is returned to the client. ie, Elmah won't get them. To log them, you need a SOAP Extension.
- Disadvantages:
- Yet another thing to learn about, in order to configure via the web.config file beyond the website proper…