API GW logging "Endpoint request body" in all requests, even 4xx and 5xx.

0

Customer would like to receive "Endpoint request body", in CloudWatch Logs, even on failed requests, when usage plan constraints are broken. They receive that information in status 200 request but do not in 4xx and 5xx requests.

Is this possible to configure?

AWS
已提問 3 年前檢視次數 1403 次
1 個回答
0
已接受的答案

Invalid API Keys or Quota exceptions will raise errors before reaching the content validation phase of your request (as well as transformation and mappings), thus not being able to capture the payload.

Customer can still enrich their logs using Custom Access Logs instead of just using plain Execution Logs, but that won't suffice for the case of errors in the Invalid API cases.

You can check the available attributes for the $context variable for Custom Access Logging here: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#context-variable-reference

AWS
管理員
已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南