Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I see AWS Gateway logs for external calls?

I need to be able to see the logs for my calls on AWS API Gateway. When I perform the calls from within Gateway's Dashboard I can see them under the Logs section.

How can I see them for external call (e.g.: calls made using curl)?

I tried enabling CloudWatch but I can only see the metric, and not the actual log messages.

like image 441
Tomas Romero Avatar asked Oct 09 '15 15:10

Tomas Romero


1 Answers

The most likely reason for not being able to see API Gateway logs in CloudWatch logs is that you haven't specified the ARN of an IAM role that enables API Gateway to write information to CloudWatch Logs.

log role arn

You then need to explicitly enable logging on each Stage. You don't need to (re)Deploy the API, just Save.

Detailed instructions here: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html#set-up-access-logging-using-console

Once enabled you will get a log group named "/aws/apigateway/welcome" with a log line confirming logs are enabled.

enabled

like image 122
Mike76 Avatar answered Oct 13 '22 20:10

Mike76