Currently uncaught exceptions log a DEBUG level message (includes stack trace) and return this in the body of the HTTP error response if DEBUG is enabled. An InternalServerError is returned without any logging if DEBUG is not enabled.
Please consider the following alternate behavior:
InternalServerError without stack trace if DEBUG is not enabled (existing behavior).See this section of code:
https://github.com/aws/chalice/blob/947eb8f22ac74c79755dda0491cab6b74a5fc099/chalice/app.py#L738
Thanks for the feedback. Just to clarify, given the last two points are existing behavior, the remaining task is to change the log level to ERROR on any uncaught exceptions? I think that seems reasonable to change.
Yes, just wanted to be very clear how all the other behaviors are great and I wouldn't want to lose them.
Oops, I guess my reply was actually wrong. I am also suggesting that the ERROR level log message is also generated when DEBUG is not enabled. I went to make the code change and realized my mistake. I'll submit a PR in a second so you can see what I'm thinking. Hopefully this change is also acceptable.
Here's the code diff to be clear, and hopefully to encourage progress on this issue ;-)
Hi @dmulter - just changed this into a PR for the chalice project. This is a pretty big deal for me for operational monitoring too.
Merged with #1144