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

Ability to remove custom key from logger via LoggingUtils #394

Closed
pankajagrawal16 opened this issue May 14, 2021 · 1 comment · Fixed by #395
Closed

Ability to remove custom key from logger via LoggingUtils #394

pankajagrawal16 opened this issue May 14, 2021 · 1 comment · Fixed by #395
Assignees
Labels
enhancement New feature or request

Comments

@pankajagrawal16
Copy link
Contributor

Hi all,
I have a question (or maybe a suggestion) about the power-tools-logging and pardon me if this is not the right place for this question.
I recently come across this Lambda Power logging and its feature of changing the logging level via environment variable is a useful one for us.
When I try to use it, I have coded to clear the custom key-pair values with ThreadContext.remove() and ThreadContext.clearAll() to avoid incorrect log output. I saw the power-tools logging LogginUtils contains method to appendKey() and appendKeys(), which in term calls ThreadContext.put() and putAll(). However, there is no wrapper methods to remove the keys.
Hence, I have to still directly import the ThreadContext class to perform the remove operation in the code.
It would be nice if LoggingUtils also include remove keys method so that my lambda code can completely rely on power-tools-logging for custom keys logging.

Originally posted by @seng-thebouqs in #393

@pankajagrawal16 pankajagrawal16 self-assigned this May 14, 2021
@pankajagrawal16 pankajagrawal16 added the enhancement New feature or request label May 14, 2021
@pankajagrawal16 pankajagrawal16 added this to To do in aws-lambda-powertools-java via automation May 14, 2021
aws-lambda-powertools-java automation moved this from To do to Done May 14, 2021
aws-lambda-powertools-java automation moved this from Done to To do May 14, 2021
@pankajagrawal16
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants