# IT:AD:Elmah:HowTo # * [[../|(UP)]] {{indexmenu>.#2|nsort tsort}} * See also: * [[IT/AD/SCOM/]] * [[IT/AD/Event Log/]] **E**rror **L**ogging **M**odules **A**nd **H**andlers (ELMAH). * ELMAH doesn't change the error experience (still see "Server Error", etc.) * ELMAH behind the scenes uses a [[IT/AD/NET/Web/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`) ![](https://dl.dropboxusercontent.com/u/11851202/Posted/IT/About/Elmah/report.gif) * 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... ## Resources ## *https://msdn.microsoft.com/en-us/library/aa479332.aspx * https://code.google.com/p/elmah/