You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Logger to support arbitrary key=value style arguments in log statements #1167
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
Use extra={} parameter as supported by Logger and in standard logging library
Activity
heitorlessa commentedon Aug 11, 2021
cc @pankajagrawal16 @saragerion @cakepietoast as I added
all_runtimeslabelsaragerion commentedon Jan 20, 2022
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 commentedon Oct 26, 2022
This will be available in the next release 🎉 !!! cc @eoinsha
github-actions commentedon Oct 26, 2022
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 commentedon Oct 31, 2022
This is now released under 2.1.0 version!