Found out how to access lambda logs from another answer
Is it possible to tail them? (manually pressing refresh is cumbersome)
Since you mentioned tail
-ing, I'm expecting that you are comfortable with working on the terminal with CLI tools.
You can install awslogs
locally and use it to tail
Cloudwatch.
e.g.
$ awslogs get /aws/lambda/my-api-lambda ALL --watch --profile production
Aside from not needing to refresh anything anymore (that's what tail
is for), I also like that you don't have to worry about jumping between different LogGroups (unlike in the CloudWatch console).
Aside: We've noticed that tailing logs gets really slow after an AWS Lambda Function has had a lot of invocations. Even looking at logs through the AWS Console is incredibly slow. This is because "tail" type utilities need to connect to each log stream. Log events get expired due to the policy you set on the Log Group itself, but the Log Streams never get cleaned up. I made a few little utility scripts to help with that:
https://github.com/four43/aws-cloudwatch-log-clean
Hopefully that save you some agony over waiting for those logs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With