fix: Change logging integration defaults (#93) · tinylambda/sentry-python@4eae772 · GitHub
Skip to content

Commit 4eae772

Browse files
authored
fix: Change logging integration defaults (getsentry#93)
* fix: Error logs are events * fix: Make handler pass through kwargs * fix: Fix logging test * fix: Work around sanic logging
1 parent 71294f5 commit 4eae772

3 files changed

Lines changed: 13 additions & 10 deletions

File tree

sentry_sdk/integrations/logging.py

Lines changed: 5 additions & 3 deletions

sentry_sdk/integrations/sanic.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from sentry_sdk.utils import capture_internal_exceptions, event_from_exception
88
from sentry_sdk.integrations import Integration
99
from sentry_sdk.integrations._wsgi import RequestExtractor, _filter_headers
10+
from sentry_sdk.integrations.logging import ignore_logger
1011

1112
from sanic import Sanic
1213
from sanic.router import Router
@@ -22,6 +23,11 @@ def install(self):
2223
# state between requests.
2324
raise RuntimeError("The sanic integration for Sentry requires Python 3.7+")
2425

26+
# Sanic 0.8 and older creates a logger named "root" and puts a
27+
# stringified version of every exception in there (without exc_info),
28+
# which our error deduplication can't detect.
29+
ignore_logger("root")
30+
2531
old_handle_request = Sanic.handle_request
2632

2733
async def sentry_handle_request(self, request, *args, **kwargs):

tests/integrations/logging/test_logging.py

Lines changed: 2 additions & 7 deletions

0 commit comments

Comments
 (0)