-
Notifications
You must be signed in to change notification settings - Fork 406
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
Bug: Register existing loggers function should use module logging, not source logger #4714
Comments
Hello @heitorlessa! Can you help with this when you get back from PTO? |
@plondino thanks a lot for submitting it! yup, I've changed to
This was the original argument back then but it got lost in between calls and PRs. I agree ^ and it's a quick change that we can include this Thursday's release. |
talked to @leandrodamascena, this will be this Thursday's release. We also publish alpha releases every morning (UTC) |
Thanks for working on this @heitorlessa! Closing as completed! #4793 |
|
This is now released under 2.42.0 version! |
Expected Behaviour
I would expect that the logging levels for code in
aws_lambda_powertools
library can be adjusted independently of the main application code.For example, if I explicitly configure the
aws_lambda_powertools
module to have an INFO level, I wouldn't get messages from the library higher than info, e.g.:logging.getLogger('aws_lambda_powertools').setLevel(logging.INFO)
I would also expect the
name
attribute of the log messages to be the module, not the service name.Current Behaviour
Currently the
copy_config_to_registered_loggers
uses the passed in source logger (the logger configured for the top level application) to log its own configuration messages, so if my source logger is set to DEBUG, I get a bunch of debug messages from this code:source_logger.debug(f"Logger {logger} reconfigured to use {source_handler}")
e.g.
This is problematic because:
a) I have no way to adjust the verbosity of this function short of setting my entire application log level
b) It shows the log messages as originating from my application and not from the powertools modules.
Ideally, the module should configure a regular Python logger and use that for its own internal logging.
Code snippet
Possible Solution
No response
Steps to Reproduce
See above
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.11
Packaging format used
PyPi
Debugging logs
No response
The text was updated successfully, but these errors were encountered: