How do you look at console.log output of the amazon lambda function

american-ninja-warrior picture american-ninja-warrior · Dec 16, 2017 · Viewed 17.8k times · Source

When you do a

console.log('Loading function');

in an amazon lambda function, where does that go?

My setup api gateway lambda function nodejs6.10 curl https://n2tredacted.execute-api.us-east-1.amazonaws.com/prod/redactedFunc

Answer

jarmod picture jarmod · Dec 16, 2017

AWS Lambda logs are written to CloudWatch Logs. Here's how to access them:

  1. select your Lambda function in the AWS console
  2. click the Monitoring tab
  3. choose View logs in CloudWatch

If you prefer to retrieve CloudWatch Logs outside of the AWS Console, then there are numerous CLI options: