'How to get Realtime Logs in Elastic beanstalk like Heroku

I am moving from Heroku to Elastic Beanstalk as advised by some team I am working with.

Now, when I was with heroku I got the benefit of real time logs as requests are been made to my application and I could easily track down error as they are happening in realtime.

Now in Elastic been stalk I am looking for how to achieve same realtime logs as in heroku.

I am new to eb commands.

I tried eb logs but the logs are not happening in real time.

How can I make this logs happen in real time as requests are been made to the Backend Server application?

Thank you



Solution 1:[1]

Real time logs can be seen by running something like...

eb logs -g /aws/elasticbeanstalk/YOUR_APP-env/var/log/LOGS_OF_CHOICE.log --stream

(where g is for the log group)

You can set up AWS cloudwatch, by running eb logs --cloudwatch-logs which will redeploy your env with cloudwatch initialised and then you can use the gui on the aws console to get a better idea what youre looking for

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Maximilian