Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to see console.log in AWS lambda functions

Where do you see the console.log() calls made inside of AWS Lambda functions? I looked at AWS Cloud Watch event log and didn't see them there. Is there a CLI way to see them?

like image 952
honkskillet Avatar asked Sep 17 '25 04:09

honkskillet


1 Answers

console.log() should definitely end up in the CloudWatch logs for your function. You should be able to find the correct log group in the web console interface for your function under the Monitoring tab - Jump to Logs. Note that you will have a different log stream for each invocation of your function, and there may be a delay between logs being written and logs showing up in a stream, so be patient.

It's possible you do not have the IAM permissions to create log groups or write to log streams. Ashan has provided links on how to fix that.

Additionally, you can use the awslogs tool to list groups/streams, as well as to download or tail groups/streams:

  • To list available groups: awslogs groups
  • To list available streams in group app/foo: awslogs streams app/foo
  • To "tail -f" all streams from a log group app/foo: awslogs get app/foo ALL --watch
like image 118
Eric M. Johnson Avatar answered Sep 19 '25 22:09

Eric M. Johnson