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

Suggestion: c.RenderError(err) to also log the error #1466

Open
chrishulbert opened this issue Aug 21, 2019 · 2 comments
Open

Suggestion: c.RenderError(err) to also log the error #1466

chrishulbert opened this issue Aug 21, 2019 · 2 comments

Comments

@chrishulbert
Copy link
Contributor

Hi all, first up: Revel is great!

I just spend a good chunk of time trying to figure out what was wrong in one of my deployed revel apps. I discovered that if your controller does return c.RenderError(err) it doesn't get logged.

The default 500.html contains 'This exception has been logged' - so i found this surprising that errors aren't logged by default.

Would you please consider adding a call to eg c.Log.Error(err.Error()) to the top of RenderError? I believe it'd follow the 'principle of least surprise' to do so :)

Have a great week all.

@ptman
Copy link
Contributor

ptman commented Aug 21, 2019

I think the status 500 probably is logged? But sure logging the error would make sense as well

@chrishulbert
Copy link
Contributor Author

You're right, the 500 is logged, but not the exception/error details (unless i'm mistaken) so i think this could be helpful.

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