Skip to content

fix(loguru): don't leak record[extra] into the record top level on opt-out#18136

Draft
KowalskiThomas wants to merge 1 commit into
mainfrom
kowalski/fix-loguru-dont-leak-record-extra-into-the-record-top-level-on-opt-out
Draft

fix(loguru): don't leak record[extra] into the record top level on opt-out#18136
KowalskiThomas wants to merge 1 commit into
mainfrom
kowalski/fix-loguru-dont-leak-record-extra-into-the-record-top-level-on-opt-out

Conversation

@KowalskiThomas
Copy link
Copy Markdown
Contributor

Description

log injection is opt-out for structured logging. Return an empty dict so the caller's record.update(...) is a no-op — previously this branch returned event_dict itself (= record["extra"]), which made the patcher copy every user-provided extra key into the log record's top level for users who had explicitly disabled injection.

@KowalskiThomas KowalskiThomas force-pushed the kowalski/fix-loguru-dont-leak-record-extra-into-the-record-top-level-on-opt-out branch from 70caca7 to 1692dfb Compare May 18, 2026 14:30
@cit-pr-commenter-54b7da
Copy link
Copy Markdown

Codeowners resolved as

ddtrace/contrib/internal/loguru/patch.py                                @DataDog/apm-core-python @DataDog/apm-idm-python
releasenotes/notes/fix-loguru-disabled-injection-extra-leak-95fa94497dd0f39b.yaml  @DataDog/apm-python
tests/contrib/loguru/test_loguru_logging.py                             @DataDog/apm-core-python @DataDog/apm-idm-python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant