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
gefragt vor 3 Jahren1403 Aufrufe
1 Antwort
0
Akzeptierte Antwort

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
MODERATOR
beantwortet vor 3 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen