

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 2
click for more info
Not enough gems
Cost: 6 gems
1: AWS Lambda
incomplete
2: Deploy Lambda
incomplete
3: Testing Lambda Functions
incomplete
4: API Gateway
incomplete
5: CloudWatch Log Groups and Viewing Lambda Logs
incomplete
6: Other Lambda Use Cases
incomplete
7: Final Cleanup
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
When something goes wrong with your Lambda, how do you see what's happening inside the function? Debugging Lambda is trickier than a local app: you can't just attach a debugger to a process. There are ways to run Lambda locally (e.g., SAM CLI) for breakpoints, or AWS Toolkit for VSCode for IDE integration. For day-to-day debugging, though, you'll rely on logs.
Lambda automatically sends everything your function writes to stdout and stderr (including print() in Python) to Amazon CloudWatch Logs. As long as your Lambda has the basic execution role (which we attached in the deploy lesson), it can write logs. AWS creates a log group for your function and streams each run's output there.
For every invocation, Lambda adds a few lines before and after your code's output:
That REPORT line is handy for spotting slow runs or functions that are close to the memory limit.
View your Lambda function's logs in CloudWatch using the console. They are created automatically when your function is invoked.
Cost check: A small Lambda like ours produces only a few KB per invocation. You'll stay well within the 5 GB free tier for this lesson, so expect $0.
Run and submit the tests to verify you can view your Lambda logs in CloudWatch.