I keep seeing 5xx errors in my Amazon API Gateway CloudWatch metrics. How do I find specific 5xx errors from API Gateway in my Amazon CloudWatch logs?
Note: If you receive errors when running AWS Command Line Interface (AWS CLI) commands, make sure that you’re using the most recent AWS CLI version.
API Gateway CloudWatch metrics show the number of 5xx server-side errors captured in a given period. To identify specific 5xx errors from API Gateway, do the following:
Note: If you're troubleshooting 504 errors from API Gateway, see How do I troubleshoot HTTP 504 errors from my API Gateway REST API?
For information on how to use the filter-log-events command, see How do I find API Gateway REST API errors in my CloudWatch logs? For information on how to use CloudWatch Logs Insights, see Analyzing log data with CloudWatch Logs Insights.
Set up CloudWatch API logging using the API Gateway console
View API Gateway log events in the CloudWatch console