Skip to content

Ability to remove custom key from logger via LoggingUtils #394

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

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
feature-request 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants