Is there a CLI utility for tailing logs from Elastic Beanstalk applications. Specifically a python flask application.
You can use their eb CLI to get a snap shot ...
eb logs
But I would like to do (similar to what heroku offers)...
eb logs --tail
Has any one accomplished this?
Thanks!
Some references:
Open the Elastic Beanstalk console , and in the Regions list, select your AWS Region. In the navigation pane, choose Environments, and then choose the name of your environment from the list. If you have many environments, use the search bar to filter the environment list. In the navigation pane, choose Logs.
The EB CLI is a command line interface for AWS Elastic Beanstalk that provides interactive commands that simplify creating, updating and monitoring environments from a local repository. Use the EB CLI as part of your everyday development and testing cycle as an alternative to the Elastic Beanstalk console.
$ eb logs -cw enable Enabling instance log streaming to CloudWatch for your environment After the environment is updated you can view your logs by following the link: https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#logs:prefix=/aws/elasticbeanstalk/ environment-name / Printing Status: 2018-07-11 21:05: ...
You can view a list of Amazon EC2 instances running your AWS Elastic Beanstalk application environment through the Elastic Beanstalk console. You can connect to the instances using any SSH client. You can connect to the instances running Windows using Remote Desktop.
UPDATE: My answer keeps getting upvotes, but things have changed since 2013. It is now easier to tail EB logs—look at posit labs's answer for a simpler way to do it :-).
Original answer:
I had been struggling with this one too. The eb CLI utility does not seem to allow for tailing your application logs currently.
However, you can tail these logs by:
.pem
file)tail -f /var/log/nodejs/nodejs.log
. I don't know what's the equivalent for a Flask application.(Thanks to Richard Soutar for pointing me in the right direction on this one.)
You can use the -g
flag to set the log group, then use --stream
to stream the results. No need to ssh into a specific machine.
eb logs -g /aws/elasticbeanstalk/yourApp-env/var/log/nodejs/nodejs.log --stream
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