Can I add custom log files to the logs captured by elastic beanstalk’s ‘eb logs’ command?

Question:

When I request the log files for an elastic beanstalk environment either through the web interface or “eb logs” I get the contents of the log files /var/log/eb-version-deployment.log, /opt/python/log/httpd.out, /var/log/cfn-hup.log, and several others.

Is there a way to add an additional log such as test_output.log to logs collected by the web interface and “eb logs”?

Answer:

Elastic Beanstalk looks in this folder for configuration files regarding which logs to tail:

On my box there are a handful of files there

And each one has one line in it, like this:

or

Use .ebextensions to add a config file to tail your own logs:

More info here:

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.logging.html#health-logs-extend

Leave a Reply