How to Tail Amazon CloudWatch Logs from Your Terminal

I'm a software engineer interested in Cloud technologies and web applications.
Search for a command to run...

I'm a software engineer interested in Cloud technologies and web applications.
AWS series dedicated to AWS CloudWatch. This should be your AWS command center!
I recently found a memory leak in one of my applications. This motivated me to write a post about how you can profile a Spring Boot web app using Visual VM. Today, I will be discussing how I initially found this leak using Amazon CloudWatch and what ...
A lot of the documentation can be found here on Spring's website about the threat. The most important part is the second paragraph. Spring Boot users are only affected by this vulnerability if they have switched the default logging system to Log4J2....

AWS CDK Pro Tips

Query a Postgres database using a Lambda in 5 minutes!

Beware Implicitly 'any'!

Learn about the benefits of serverless

On this page
This week I deployed a production full-stack application to AWS. This was the first web application that I deployed that relied solely on Amazon CloudWatch for logging. Amazon CloudWatch has been the control center for metrics on the health of my application. I monitor everything from ECS memory utilization to an Application Load Balancer unhealthy host count. My team is instantly notified when one of these metrics turns into an alarm. This service is invaluable when you are launching a new application that requires high availability. However, I quickly noticed something was missing...
Nonetheless, I was very disappointed when our first live event kicked off and I went to Amazon CloudWatch to check out the logs to see what was going on. There is no tailing! Every time there was a new event in the logs I had to scroll down. For anyone who has ever had to monitor logs, this is an extreme inconvenience. When you are monitoring an application in real-time you need the ability to tail them. Tailing logs is in reference to watching them in near real-time as they occur.
To sum up, I was able to find a solution to tail Amazon CloudWatch logs! There is a simple AWS CLI command you can use to tail your logs from your own command line. After reading StackOverflow and the AWS documentation documentation I found a solution. I was very happy with this solution as I have a warm heart for the terminal. I hope this helps someone else who is unable with the ability to tail logs on AWS!
aws logs tail --since 1d --follow #YOUR_LOG_GROUP