How do I find 5xx errors from API Gateway in my CloudWatch logs?

Lesedauer: 2 Minute

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:

  1. Enable execution logging and access logging in your Amazon CloudWatch Logs.
  2. Use either the filter-log-events AWS CLI command or CloudWatch Logs Insights to find specific 5xx errors from API Gateway.

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.

Related information

Set up CloudWatch API logging using the API Gateway console

View API Gateway log events in the CloudWatch console

AWS OFFICIALAktualisiert vor 2 Jahren
Keine Kommentare