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

isDebugEnabled() returning false when debug enabled through env var #293

Closed
asmith-r7 opened this issue Feb 23, 2021 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@asmith-r7
Copy link

asmith-r7 commented Feb 23, 2021

I have several sections in my debug wrapped in the logger.isDebugEnabled()
What I noticed is that setting the log level to debug through the env var LOG_LEVEL causes these log lines not to appear. This seems like a bug to me.

Expected Behavior

isDebugEnabled should return true.

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

  1. Configure logging via config to be INFO
  2. Override to DEBUG via LOG_LEVEL env var

Environment

  • Powertools version used:
  • Packaging format (Layers, Maven/Gradle):
  • AWS Lambda function runtime:
  • Debugging logs

How to enable debug mode**

# paste logs here
@asmith-r7 asmith-r7 added the bug Something isn't working label Feb 23, 2021
@rb2010 rb2010 assigned rb2010 and unassigned rb2010 Feb 26, 2021
@pankajagrawal16
Copy link
Contributor

pankajagrawal16 commented Feb 27, 2021

Thanks @asmith-r7 For reporting the issue. I did some digging and Can see that the LOG_LEVEL env variable gets overridden by system property back to INFO.

Which means that either we will have to find another name for our environment variable to be something like POWERTOOLS_LOG_LEVEL instead. Something like this

or we will have to support it via java tool options via

JAVA_TOOL_OPTIONS: -DLOG_LEVEL=DEBUG.

In terms of user experience, I believe having a different environment variable names is better than the later.

@pankajagrawal16
Copy link
Contributor

Available in 1.3.0 now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants