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

Allow selection of which errors to log in the attribute declaration #15

Open
ghost opened this issue Jul 25, 2014 · 2 comments
Open

Allow selection of which errors to log in the attribute declaration #15

ghost opened this issue Jul 25, 2014 · 2 comments

Comments

@ghost
Copy link

ghost commented Jul 25, 2014

It'd be nice if we could optionally log 400 and 404s. I understand the reasoning in #13, but everyone's use case is different.

What about [ElmahHandleErrorApi(LoggedErrors="400,500-999")] or similar?

@rdingwall
Copy link
Owner

Hi @voltagex, did you ever end up solving this? I was thinking something along the lines of:

[ElmahHandleErrorApi(Include.AllExcept, 404, 403, 401)]

[ElmahHandleErrorApi(Include.AllExcept, HttpErrorCodeRange.5xx, HttpErrorCodeRange.4xx)]

[ElmahHandleErrorApi(Include.Only, HttpErrorCodeRange.5xx)]

Or multiple attributes working together:

[ElmahHandleErrorApi, Include(HttpErrorCodeRange.5xx), Exclude(500)]

@mikesigs
Copy link

mikesigs commented Sep 2, 2015

I also ran into this today too. I would like to see 400 errors. For example, when ModelState is invalid a "400 Bad Request" response is returned. In my case, this invalid request would be coming from my front-end written in Angluar (which doesn't log errors, other than to the browser console). So if I get a support ticket that the user got "some weird error", I could at least go and see this in Elmah and determine if there is a bug in the UI code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants