All Products
Search
Document Center

Configure the logging of HTTP requests and responses

Last Updated: Dec 07, 2020

If you want API Gateway to log the HTTP requests it receives and the HTTP responses it returns, you can perform the operations described in this topic.

You can perform these configurations only for dedicated instances.

Log settings
  • Record the requestHeaders: Separate the names of request headers that you want to record with commas (,). You can set the value to ' * '. This value indicates that all headers are recorded.

  • Record the responseHeaders: Separate the names of response headers that you want to record with commas (,). You can set the value to ' * '. This value indicates that all headers are recorded.

  • Record the queryString: Separate the names of fields that you want to record with commas (,). You can set the value to ' * '. This value indicates that all fields are recorded.

Then, you can view the related information in logs. The following figure shows a log.

View logs

After the preceding log settings are configured, the system records the following fields in logs: requestBody, responseBody, requestHeaders, responseHeaders, and queryString. The size of each field must be no more than 4,096 bytes. If the size of a field exceeds this limit, the system truncates the field before it is recorded.