Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors not being logged #8

Closed
oragorn opened this issue Apr 13, 2015 · 3 comments
Closed

Errors not being logged #8

oragorn opened this issue Apr 13, 2015 · 3 comments
Labels
bug Issues describing a bug or pull requests fixing a bug.

Comments

@oragorn
Copy link

oragorn commented Apr 13, 2015

I noticed that the project is not logging 404 and 500 among other errors. Is this intentional? How do I configure the project to log these errors on Elmah?

My problem runs deeper than this. My WebApi setup is throwing a 500, but I can't find the reason because the response is showing the custom error page.

@RehanSaeed
Copy link
Member

Thanks for logging this issue. Take a look at the change log or create a new project from the template (I've not yet checked in the code but will this afternoon).

I've fixed the issue with logging 500 errors. When I introduced an 'Error' folder yesterday to contain the new static error pages for 503 and 504 errors, this conflicted with the '/error' route. I've now renamed the '/error' route to 'error/internalservererror'.

I'm not sure why Elmah is not logging 404 errors. I've raised this issue with Elmah.MVC. I'll try to play around with it more and see if I can figure it out.

Its worth noting also that Elmah will NOT handle 500 errors raised by IIS. If this happens it means something catastrophic happened to your site and MVC was not even able to start and so Elmah was not able to run. This is where IIS logging comes in.

@RehanSaeed
Copy link
Member

I have found that the problem is with Elmah.MVC. It stops logging correctly if we use only attribute routing. You can fix the issue if you add the code below. I am waiting for a response from Elmah.MVC before I add this code as I want to understand what is going wrong.

routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );

@RehanSaeed
Copy link
Member

The default route above has been added by default, with a comment about it being required to satisfy Elmah. I'll keep any eye out for any updates.

@RehanSaeed RehanSaeed added the bug Issues describing a bug or pull requests fixing a bug. label Dec 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues describing a bug or pull requests fixing a bug.
Projects
None yet
Development

No branches or pull requests

2 participants