Using ELMAH inside my asp.net mvc 4 and MVC5 web application

I have two asp.net mvc web applications; asp.net mvc4 and asp.net 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 asp.net vmc4 and asp.net mvc5 in the same way?

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

inside my asp.net 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

+3


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.

+8


source







All Articles