-
Notifications
You must be signed in to change notification settings - Fork 420
Bug: Logs populating into cloudwatch as multiple lines instead of a single object #3763
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
Comments
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
trying to reproduce it now... from my recollection that only happens when you have |
Couldn't reproduce, will try more scenarios
![]() |
Looks like you are correct that it's from the POWERTOOLS_DEV; when I set that to false the logs started populating as single lines. So this is expected behavior when POWERTOOLS_DEV is true; is there a way to work around that? It makes sense when running locally with SAM, but it makes the logs a pain when testing in AWS. |
I'm sure we can figure something out -- what made you enable Customers also use this feature with |
Summarizing our discussion on Discord. What you were after was
I'm closing this issue and created a PR to make this more explicit in our docs to prevent future confusion. Thank you so much for taking the time to report this and help improve the docs! |
|
This is now released under 2.34.0 version! |
Expected Behaviour
I'm expecting the logs to populate as a single json object in cloudwatch.
Current Behaviour
Logger logs are shown as single lines within cloudwatch creating a lot of lines within the log stream. I have tried the log format as text and JSON and get the issue both ways.
Code snippet
Possible Solution
No response
Steps to Reproduce
Lambda using the powertools layer arn:aws:lambda:us-east-1:017000801446:layer:AWSLambdaPowertoolsPythonV2:60, followed the guide for basic logging with context included. All logs created via logger.info() or logger.debug() have the issue.
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.12
Packaging format used
Lambda Layers
Debugging logs
No response
The text was updated successfully, but these errors were encountered: