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?

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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ