1 Answer
- Newest
- Most votes
- Most comments
1
There are three main ways to view your Lambda function logs in CloudWatch:
- 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
Each log stream corresponds to an instance of your function. To filter logs for a specific invocation, you can use AWS X-Ray to record details about the request and the log stream in the trace. The Lambda runtime automatically logs the start and end of each function invocation, including details like request ID, duration, memory usage, and more. Any console.log statements (or equivalent in your programming language) will appear in these logs.
Sources
CloudWatch for Newbies | AWS re:Post
Log and monitor Node.js Lambda functions - AWS Lambda
Viewing CloudWatch logs for Lambda functions - AWS Lambda
Log and monitor TypeScript Lambda functions - AWS Lambda
Relevant content
- asked a year ago
- asked a year ago
- AWS OFFICIALUpdated a year ago
