How can I see AWS Gateway logs for external calls?

蹲街弑〆低调 提交于 2020-01-22 17:55:55

问题


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.


回答1:


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.

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

Detailed instructions here: http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-stage-settings.html#how-to-stage-settings-console

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



来源:https://stackoverflow.com/questions/33042498/how-can-i-see-aws-gateway-logs-for-external-calls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!