Using ELMAH inside my mvc 4 and MVC5 web application

I have two mvc web applications; mvc4 and mvc5, both deployed under iis7 on two separate virtual machines.

now i'm running into problems throwing unhandled exceptions because users will be redirected to the "Error" view inside the shared folder under the "View" section. and I cannot know exactly the details of the exception.

so I read about using ELMAH tool which automatically logs all exceptions handled by UN. but my question is what steps should i follow to set up the tool inside myC application?

second question; will ELMAH work on vmc4 and mvc5 in the same way?

Third question. now i have a custom error set to <customErrors mode="RemoteOnly" />

inside my mvc web app as i dont want end users to be subject to technical details about any exception, so when using elmah i have to set a custom error no? Thanks to


source to share

1 answer

1) Just install Elmah from Nuget. This will allow it with default configuration to save exceptions to XML

2) Yes, it should work in both MVC4 and 5

3) No, you can leave it as it is. Elmah's page is available by default only. Users will be redirected to the error page and you can use the elmah url locally to access the actual error information.



All Articles