Skip to content

Capture Loguru log args as parameters #4475

@sentrivana

Description

@sentrivana

Right now the Loguru Sentry logs integration doesn't capture args, kwargs provided to the logger, only the already formatted message. This is because Loguru pre-formats the message and we only have access to the already formatted message in the handler.

We've submitted a feature request to Loguru to potentially get access to the args & kwargs but maybe there's another way to get this to work?

Monkeypatching isn't straightforward because all the logic is in one function and the log record is also created there.

Goals:

  • support extras
  • support contextualize
  • update the Logs docs
  • update the Loguru docs

Metadata

Metadata

Assignees

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions