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
preguntada hace 3 años1403 visualizaciones
1 Respuesta
0
Respuesta aceptada

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
MODERADOR
respondido hace 3 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas