- Newest
- Most votes
- Most comments
You can view logs for your Lambda function in several ways:
- Using the Lambda console:
- Go to the Lambda console
- Select your function
- Choose the "Monitor" tab
- View the execution results in the "Logs" section
- You can also check the "Details" section when using the console test feature
- Using the CloudWatch console:
- Open the CloudWatch console
- Navigate to the "Log groups" page
- Find and select the log group for your Lambda function (it will be named "/aws/lambda/your-function-name")
- Click on a log stream to see the detailed logs
- Using the AWS Command Line Interface (CLI):
- You can retrieve logs using the AWS CLI with the --log-type command option
- The logs can be decoded using base64
By default, Lambda automatically captures logs for all function invocations and sends them to CloudWatch Logs, provided your function's execution role has the necessary permissions. Each log stream corresponds to an instance of your function. The Lambda runtime automatically logs the start and end of each function invocation, including details like request ID, duration, memory usage, and more.
You can also use CloudWatch Logs Live Tail to view and filter logs in real time through the Lambda console.
Sources
What is the easiest way to view logs for a Lambda function in AWS CloudWatch? | AWS re:Post
Sending Lambda function logs to CloudWatch Logs - AWS Lambda
Viewing CloudWatch logs for Lambda functions - AWS Lambda
Relevant content
- asked 5 years ago
- asked 14 days ago
- AWS OFFICIALUpdated 3 months ago