Comments (10)
Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link
from powertools-lambda-python.
trying to reproduce it now... from my recollection that only happens when you have \n
since CloudWatch Logs creates a new line like that. Logger
prints as a string. The only behavior change is when you have POWERTOOLS_DEV
env var where we increase indentation .
from powertools-lambda-python.
Couldn't reproduce, will try more scenarios
- Same code snippet on Python 3.11
- Same code snippet older Powertools for AWS Lambda version (2.31.0)
- Same code snippet on Python 3.12
- Use
POWERTOOLS_DEV
env - Use
POWERTOOLS_DEBUG
env - Copy existing Logger config to other std/libraries (noticed in your screenshot X-Ray/boto appears)
from powertools-lambda-python.
As expected, reproduced with POWERTOOLS_DEV
where indentation is increased for local debugging. Checking the last scenario to triple check.
Local effect (intended use case)
Local effect with SAM CLI logs
pulling from CloudWatch Logs
CloudWatch Logs effect (extra indentation is transformed
from powertools-lambda-python.
All scenarios tested, this only seems to occur due to POWERTOOLS_DEV
as expected -- could you please check whether you have that turned on?
Logger config copied to boto3+X-Ray SDK loggers + DEBUG log level
from powertools-lambda-python.
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.
from powertools-lambda-python.
I'm sure we can figure something out -- what made you enable POWERTOOLS_DEV
? That will help understand alternative solutions or trade-offs we might be able to make.
Customers also use this feature with pytest
live debugging feature.
from powertools-lambda-python.
Summarizing our discussion on Discord.
What you were after was POWERTOOLS_DEBUG
to get extra details about every operation (Logger) while using CloudWatch Logs view.
POWERTOOLS_DEV
on the other hand is focused on local development, where you want to run your code locally with tools like SAM CLI, or pytest
live log feature.
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!
from powertools-lambda-python.
⚠️ COMMENT VISIBILITY WARNING⚠️
This issue is now closed. Please be mindful that future comments are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
from powertools-lambda-python.
This is now released under 2.34.0 version!
from powertools-lambda-python.
Related Issues (20)
- Maintenance: Refactor artifact name strategy for parallel uploads HOT 5
- Maintenance: Roadmap update HOT 3
- Maintenance: Update readme to style badge and remove email HOT 3
- Maintenance: Layer ARN release update is partially working HOT 4
- Bug: payload validation is skipped when item is returned via `ReturnValuesOnConditionCheckFailure` HOT 11
- Docs: remove leftover announcement banner HOT 2
- [I Made This]: reinvent session & code with Heitor HOT 3
- Docs: Fix feature flags documentation HOT 4
- Bug: Swagger generated UI has JSON format invalid URL HOT 4
- [I Made This]: Serverless API Documentation with Powertools for AWS HOT 1
- Feature request:Provide event handler for Lexv2 lambda integration HOT 1
- Bug: idempotency logic should first validate the payload and then cache HOT 2
- Bug: Event Handler Data Validation `KeyError: 'multiValueHeaders'` regression when running locally HOT 3
- Docs: Improve install section with minimal dependencies first HOT 2
- Static typing: missing @overload to ensure return type is a str when default_value is set HOT 3
- Bug: RequestValidationError handling behavior should not be affected if we add exception handler for Exception HOT 7
- Feature request: Function to retrieve mutli-value query string parameters HOT 2
- Feature request: Add event object sent from Cloudwatch Alarms HOT 7
- Bug: CORS headers not appending to API Gateway REST API responses HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powertools-lambda-python.