Make the log level in DebugExceptions configurable #48575
Merged
+77
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation / Background
Fixes #47643
This middleware has been logging at a FATAL level since the first commit in Rails (the code originally lived in actionpack/lib/action_controller/rescue.rb). However, FATAL is documented in the Ruby Logger docs as being for "An unhandleable error that results in a program crash.", which does not really apply to this case since DebugExceptions is handling the error. A more appropriate level would be ERROR, which the Ruby Logger docs describe as "A handleable error condition."
Detail
This commit introduces a new configuration for the DebugExceptions log level so that new apps will have it set to ERROR by default and ERROR can eventually be made the default.
Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]