Amazon API Gateway Execution Logs Break the 1 KB Wall — Now Up to 1 MB, With Your Choice of Delivery Destination!
Hi, it's me, Shiichan! Today I found an update that makes API Gateway logs way more useful, so let's dive in!
AWS What's NewWhat was announced?
According to AWS What's New, Amazon API Gateway REST API execution logs can now be routed to delivery destinations of your choice, and the maximum log event size has grown a lot too.
The story so far
Until now, execution logs could only go to a single, API Gateway-managed CloudWatch Logs log group, and each log event was truncated at 1 KB. That made it hard to see the full request and response content when you actually needed it.
What changes
Log events can now hold up to 1 MB, and you get to choose where they go — even to multiple destinations at the same time:
- Your own Amazon CloudWatch Logs log groups
- Amazon S3 buckets
- Amazon Data Firehose streams
For example, you could send logs to S3 in Apache Parquet format for cost-efficient long-term storage and analysis with Amazon Athena, while simultaneously delivering structured JSON logs to CloudWatch Logs for real-time alerting.
Dive Deep
This feature is available in all AWS Regions where API Gateway REST APIs are available, including the AWS GovCloud (US) Regions.
Pricing follows vended logs rates — check the Amazon CloudWatch pricing page for details.
You can set this up through any of the following:
- The API Gateway console
- AWS CLI
- AWS CloudFormation
Wrap-up
- Amazon API Gateway REST API execution logs now support log events up to 1 MB, up from the previous 1 KB truncation limit
- You can choose delivery destinations among Amazon CloudWatch Logs, Amazon S3, and Amazon Data Firehose, and even deliver to multiple destinations at once
- You can mix strategies, like Parquet-format logs in S3 for Athena analysis plus JSON logs in CloudWatch for real-time alerting
- Available in all Regions where API Gateway REST APIs are supported, including AWS GovCloud (US); billed at vended logs rates
- Configurable via the API Gateway console, AWS CLI, or AWS CloudFormation
- A welcome update if you run API Gateway and need to actually see full request/response content in your logs!