Logger
It’s a wrapper of Python’s logging library that provides extra capabilities such as JSON output configuration (and many more).
Key features¶
- Capture key fields from Lambda context, cold start and structures logging output as JSON
- Log Lambda event when instructed (disabled by default)
- Append additional keys to structured log at any point in time
Usage in Handler¶
my_handler.py | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Blog Reference¶
Read more about the importance of the logger and how to use AWS CloudWatch logs in my blog. Click HERE
More Details¶
You can find more information at the official documentation.
Go to https://docs.powertools.aws.dev/lambda-python/latest/core/logger/