Retrieving Execution Logs
The Monitoring tab also has a quick link to inspect CloudWatch logs. Click the View logs in Cloudwatch button, and you’ll see the CloudWatch log group for your function.
CloudWatch groups logs in two levels of hierarchy:
- log groups
- log streams
Log groups correspond to a logical service. AWS Lambda creates a log group for each function. A single log group can have multiple log streams, which typically correspond to a single running process. Lambda creates a log stream for each container instance (each cold start). If Lambda reuses the container for subsequent requests, the logs will appear in the same stream. If it creates a new container, the logs will appear in a new stream (refer to the figure below).