Skip to content

LogfmtRenderer has a bug with escaped double quotes #511

@davellas

Description

@davellas

In the code of LogFmtRenderer there is:

value = f"{value}".replace('"', '\\"')

However if you are trying to render an escaped double quote like
"I want to render this \"string\" with logfmtrenderer"

it ends up rendering it as
\"I want to render this \\"string\\" with logfmtrenderer\"

\\" is wrong and won't be parsed correctly by a logfmtparser.

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