route TRACE log entries to debug.log, not error.log#3123
Merged
Conversation
Contributor
📊 Performance Benchmark Report
📈 Detailed Results (All Benchmarks)
🎯 Performance Summary✅ No significant performance changes detected (all changes <10%) 🐍 Python Version 3.11.15 |
1211d37 to
8e83e91
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #3123 +/- ##
=====================================
- Coverage 90% 90% -0%
=====================================
Files 441 441
Lines 38758 38758
=====================================
- Hits 34679 34676 -3
- Misses 4079 4082 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
error.logis currently a misnomer — its filter matcheslevelno == TRACE or levelno >= ERROR, so everyself.trace()call (which modules use for "API responded with a non-2xx, here's the body" diagnostic noise) ends up inerror.logalongside actual errors. A sample 24-hour scan produced 145K lines oferror.logmade up almost entirely ofJSONDecodeErrors from crt/anubisdb/subdomaincenter parsing non-JSON error pages,401 Incorrect API Keytraces from leakix, Cloudflare-challenge HTML dumps from skymem, etc. — all already gracefully handled by the modules' try/except blocks. This drowns out anything genuinely worth surfacing.This change scopes
error.logto ERROR + CRITICAL only. TRACE entries continue to flow intodebug.log(whose filter islevelno >= DEBUG, and TRACE=49 is above DEBUG=10), so no diagnostic information is lost — it just moves to the right file.Note on the explicit
!= TRACEclausebbot defines
TRACE = 49(just belowCRITICAL = 50), so a plain>= ERRORfilter would still match TRACE. The explicitand x.levelno != logging.TRACEexcludes it. Same approach used bymain_handlerand the core logger'sdebug_handlerinbbot/core/config/logger.py.