3

I am using serverless framework https://www.serverless.com/

I have created a http api gateway - https://www.serverless.com/framework/docs/providers/aws/events/http-api/

And enabled logging like so

provider:
  name: aws
  runtime: nodejs12.x
  logs:
    httpApi: true

Im looking for execution logs but im unable to see it in cloudwatch log groups.

From this documentation - https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/ it suggests execution logs are enabled by default when its a restApi: true but there is no mention of execution logs when you have a httpApi

1
  • 2
    Can you verify that the required IAM role has been created correctly? Also if you go to API gateway console, can you double check log settings? Commented Jun 23, 2020 at 12:14

2 Answers 2

5

Execution logs are not available with HTTP APIs because they only support proxy integrations with Lambda and HTTP endpoint. So ideally there would be no transformation in request/response going in/out of API Gateway. Whatever request parameters client sends can be seen at the integration - so enable logging on Lambda/HTTP side to see the request details.

If you want to use access logs to troubleshoot errors for HTTP API, there is a new context variable $context.integrationErrorMessage that will give the error message in a similar format we see in execution logs for the traditional REST API.

Sign up to request clarification or add additional context in comments.

Comments

2

As of writing this HTTP API does not have support for Execution logs.

https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.