简体   繁体   中英

How to log complete Request /Response of aws api gateway rest api?

As the title says: How can I log all the information of request and response of AWS Api Gateway Rest api including the body? Few things that are on my mind:

  1. Cloudwatch : Reject because there is a limit of 1024 bytes + we cannot log request/response body and headers.
  2. Create a lambda function Logger which would log the details in a database and integrate it in between the endpoints like this:
    Client Request ===> Logger (for logging request) ===> processing ===> Logger (for logging response) ===> send response to client. (How can I intergrate this Logger lambda function?) The Logger will act as middleware for all the api gateway calls

@srp321 's comment is the answer. Step function. Normal lambda function does not chain through api gateway.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM