Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
heitorlessa opened this issue May 14, 2021 · 5 comments · Fixed by #1658
Closed

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

heitorlessa opened this issue May 14, 2021 · 5 comments · Fixed by #1658
Assignees
Labels
feature-request feature request

Comments

@heitorlessa
Copy link
Contributor

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

@heitorlessa
Copy link
Contributor Author

cc @pankajagrawal16 @saragerion @cakepietoast as I added all_runtimes label

@saragerion
Copy link

This is already supported by the TypeScript powertool 🥳
https://github.com/awslabs/aws-lambda-powertools-typescript/blob/main/packages/logger/tests/unit/Logger.test.ts#L286

@heitorlessa heitorlessa transferred this issue from aws-powertools/powertools-lambda Apr 28, 2022
@heitorlessa heitorlessa added the help wanted Could use a second pair of eyes/hands label Aug 1, 2022
@heitorlessa heitorlessa linked a pull request Oct 3, 2022 that will close this issue
1 task
@heitorlessa
Copy link
Contributor Author

This will be available in the next release 🎉 !!! cc @eoinsha

image

@heitorlessa heitorlessa removed the help wanted Could use a second pair of eyes/hands label Oct 26, 2022
@heitorlessa heitorlessa linked a pull request Oct 26, 2022 that will close this issue
7 tasks
@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions github-actions bot added the pending-release Fix or implementation already in dev waiting to be released label Oct 26, 2022
@github-actions
Copy link
Contributor

This is now released under 2.1.0 version!

@github-actions github-actions bot removed the pending-release Fix or implementation already in dev waiting to be released label Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment