How to setup Elmah.MVC with ASP.NET MVC 4 ?

What is Elmah ? ELMAH is an open source project whose purpose is to log and report unhandled exceptions in ASP.NET web applications.

Why to use Elmah ? ELMAH serves as an unobtrusive interceptor of unhandled ASP.NET exceptions, those usually manifesting with the ASP.NET yellow screen of death.

So now we know what and why to use Elmah, Lets quickly get started on how to use Elmah with your ASP.NET MVC project.

Step 1: Right click on your solution and select the “Manage Nuget Packages” option

Elmah - Step 1 - Manage Nuget Packages

Step 2: In the Nuget Package manager search for “Elmah” and install the Elmah.MVC nuget extension.

Step 2 - Elmah - Elmah mvc nuget search

The Nuget Package manager will download and add the required dlls and modify the web.config’s <appSetting> for Elmah to work.

Step 2 - Elmah - Elmah mvc nuget web config

Step 3: That’s it !! Your Elmah is now ready to test. I have generated a 404 to test if my Elmah works, ELMAH can be accessed by this url :

Elmah - Output Screen 0

Elmah - Output Screen 1

Hope this helps 🙂

Further Reading :