3

I have two asp.net mvc web applications; asp.net mvc4 and asp.net mvc5 , they are both deployed under iis7 on two separate VMs.

now i am currently facing problems when un-handled exceptions are raised,,, because users will be re-directed to the Error view inside the shared folder under the view section. and i am unable to know exactly the exception details..

so i have read about using the ELMAH tool which will automatically logs all the UN-handled exceptions. but my question is that what are the steps that i need to follow to configure the tool inside myC application ?

second question; will ELMAH works on asp.net vmc4 and asp.net mvc5 in the same way?

Third question. now i have custom error set to <customErrors mode="RemoteOnly" /> inside my live asp.net mvc web application, since i do not want end users to be exposed to the technical details about any exception, so when using elmah should i set the custom error to be no ? Thanks

1 Answer 1

8

1) Just install Elmah from Nuget. That will enable it with the default configuration to save exceptions to an XML file

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

3) No, you can leave it as it is. The Elmah page is available locally only by default. Users will be still redirected to your Error page, and you can use the elmah URL locally to access the actual error information.

Sign up to request clarification or add additional context in comments.

9 Comments

Thanks a lot, but how i will be able to view the error logs ?
By default elmah expose them in the following URL yourapp/elmah.axd. Which must be accesible only locally. It store the data in an xml file but there are extension to store to database or wherever it suits you.
ok now i access the elmah using the following URL localhost:444/myapp/elmah.axd, but i got "no error found",, although i intentionally made an un-handle exception to my application ... can you adivce
In a file. Still you need to check rights. I only said that I used to have the same problem when I used a database and have those problems with it. Not that those are yours :)
Yes that is probably for just asp .net. Try the second link and see what happens :)
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.