Skip to content

ProcessorFormatter should be able to pass the message unformatted #520

@karolinepauls

Description

@karolinepauls

"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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions