Skip to content

chore: deduplicate logging and clean up config - #10592

Merged
jennifer-richards merged 9 commits into
ietf-tools:mainfrom
jennifer-richards:log-dedup
Mar 23, 2026
Merged

chore: deduplicate logging and clean up config#10592
jennifer-richards merged 9 commits into
ietf-tools:mainfrom
jennifer-richards:log-dedup

Conversation

@jennifer-richards

Copy link
Copy Markdown
Member

The only functional change here is preventing double log entries on 5xx requests. This was happening because the django.request logger had its own handler attached. As refactored here, 4xx errors (warnings) are discarded by the "level" filter in the django.request logger, and the actual log is emitted after propagating up to the django logger.

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 SuspiciousOperation errors. Instead, configures the django.security logger to be console-only and not to propagate.

Adds status_code to the JSON log. This is only relevant for django.request logs, where it will normally be 500. Other logs will have a null value.

Beware a little bit of churn in the commits...

@jennifer-richards
jennifer-richards marked this pull request as ready for review March 20, 2026 06:47
@codecov

codecov Bot commented Mar 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.36%. Comparing base (76fd25a) to head (7b30a77).
⚠️ Report is 13 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jennifer-richards
jennifer-richards merged commit 10ebdf9 into ietf-tools:main Mar 23, 2026
10 checks passed
@jennifer-richards
jennifer-richards deleted the log-dedup branch March 23, 2026 18:44
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants