18

I have Code First MVC 4 application.

I tried installing the NuGet package for logging Elmah - and everything seemed to work fine - Errors were reported fine at http://myapp/elmah.axd

I then noticed there was an Elmah.MVC package - so i removed the original one, and installed that. It no longer worked here: http://myapp/elmah.axd

I have read in a few places that for MVC apps, you should use the 'Elmah.MVC' package - rather than the 'Elmah' package - but why is this? What would the practical difference be? Is this still the case with MVC 4 sites?

It is strange the original package works out of the box and the MVC one doesn't.

Which should I use and why?

Justin Helgerson
  • 24,900
  • 17
  • 97
  • 124
niico
  • 11,206
  • 23
  • 78
  • 161
  • 4
    After installing Elmah.MVC your route becomes `http://myapp/elmah` unless you configure otherwise. – Jasen May 23 '13 at 18:14

1 Answers1

31

According to the Nuget website, you can access Elmah using the url /elmah.

https://www.nuget.org/packages/Elmah.MVC

Painless integration of ELMAH functionality into ASP.NET MVC Application. Just drop the package inside you ASP.NET MVC application and access /elmah URL. It will also install global HandleError filter, that guarantees all unhandled errors is logged (even if customerError turned "On").

Rhapsody
  • 6,017
  • 2
  • 31
  • 49
  • 2
    The [Github Project Page](https://github.com/alexanderbeletsky/elmah-mvc) link on the NuGet page is especially useful in answering *why* -- Routing, Authorization strategies, and configuration. – Jasen May 23 '13 at 18:07