Skip to content

Logger to support arbitrary key=value style arguments in log statements #1167

Closed
@heitorlessa

Description

@heitorlessa

Original author: @CeeBeeCee

Runtime: Python

Is your feature request related to a problem? Please describe

As per discussion originally posted on Python repo, this feature request is related to Logger being able to use key value arguments in log statements e.g. logger.info("my message", my_key="value", request_id="123d023f0-alk322f").

Describe the solution you'd like

I'd like to add additional keys on a per log statement basis by passing an arbitrary number of key=value arguments to .info, .warn, etc..

Describe alternatives you've considered

  1. Use extra={} parameter as supported by Logger and in standard logging library
  2. Continue to use structlog

If you provide guidance, is this something you'd like to contribute?

Additional context

Metadata

Metadata

Labels

Type

No type

Projects

Status

Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions