How do I set up access logging for API Gateway?

2 minute read
0

I want to set up access logging for Amazon API Gateway.

Short description

To debug issues related to request execution or client access to your API, you can activate Amazon CloudWatch Logs to log API calls.

Resolution

To activate access logging for a REST API, complete the following steps:

  1. Deploy your REST API to a stage.
  2. Grant API Gateway permission to read and write logs to CloudWatch for your account.
  3. Follow steps 1-6 and 8-9 (skip step 7) of the instructions in Set up CloudWatch API logging using the API Gateway console.

To activate access logging for an HTTP API, see Configure logging for HTTP APIs in API Gateway.

You can now use your CloudWatch logs to debug API issues. For example, to find errors with a REST API, see How do I find API Gateway REST API errors in my CloudWatch logs?

For more information about monitoring REST APIs, see Monitor REST API execution with Amazon CloudWatch metrics.

For more information about monitoring HTTP APIs, see Monitor CloudWatch metrics for HTTP APIs in API Gateway.

Related information

How do I resolve "Invalid permissions on Lambda function" errors from API Gateway REST APIs?

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

How do I turn on CloudWatch Logs for troubleshooting my API Gateway REST API or WebSocket API?

AWS OFFICIAL
AWS OFFICIALUpdated 5 months ago