-
-
Notifications
You must be signed in to change notification settings - Fork 251
Description
structlog/src/structlog/stdlib.py
Line 1016 in f7145a6
"event": record.getMessage(), |
The problematic pipeline is logging -> ProcessorFormatter -> structlog -> Sentry.
Currently ProcessorFormatter calls getMessage
on the log record.
This means that the formatted log message from logging
becomes the "event" field in structlog
. This causes duplicates if structlog is integrated with Sentry, which groups messages by the "event" field. If the "event" field wasn't formatted, the messages would get grouped correctly.
There should be a flag on ProcessorFormatter that allows it to pass the log message unformatted, like "event": str(record.msg),
(LogRecord.msg
can be anything supporting __str__
).
Passing positional args is already supported thanks to the pass_foreign_args
flag.