chore: deduplicate logging and clean up config - #10592
Merged
Merged
Conversation
jennifer-richards
marked this pull request as ready for review
March 20, 2026 06:47
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10592 +/- ##
==========================================
- Coverage 88.36% 88.36% -0.01%
==========================================
Files 327 327
Lines 44092 44120 +28
==========================================
+ Hits 38964 38987 +23
- Misses 5128 5133 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rjsparks
approved these changes
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The only functional change here is preventing double log entries on 5xx requests. This was happening because the
django.requestlogger had its own handler attached. As refactored here, 4xx errors (warnings) are discarded by the"level"filter in thedjango.requestlogger, and the actual log is emitted after propagating up to thedjangologger.Along with the above, reformats the LOGGING code using ruff style and removes old comments that are more confusing than helpful at this point. Removes the Django 1.x method of suppressing admin mail for
SuspiciousOperationerrors. Instead, configures thedjango.securitylogger to be console-only and not to propagate.Adds
status_codeto the JSON log. This is only relevant fordjango.requestlogs, where it will normally be 500. Other logs will have a null value.Beware a little bit of churn in the commits...