Yes! There is a way. You should NEVER have to ssh into your Elastic Beanstalk instances.
We found out by examining the eb-activity.log
file.
Depending on your environment type (I use Python from Beanstalk), the locations you can put log files vary. You need to check eb-activity.log
.
For example, with the Python environment type, in eb-activity.log
you should see:
[2015-09-15T20:29:36.102Z] INFO [2403] - [Initialization/PreInitStage0/PreInitHook/01setuplogs.sh] : Completed activity. Result:
+ mkdir -p /opt/elasticbeanstalk/tasks/taillogs.d /opt/elasticbeanstalk/tasks/sytemtaillogs.d /opt/elasticbeanstalk/tasks/bundlelogs.d /opt/elasticbeanstalk/tasks/publishlogs.d
+ /opt/elasticbeanstalk/bin/log-conf -n python '-l/opt/python/log/*' -t taillogs,systemtaillogs,bundlelogs
+ /opt/elasticbeanstalk/bin/log-conf -n python-app '-l/opt/python/log/app.out.*' -t publishlogs
+ /opt/elasticbeanstalk/bin/log-conf -n supervisord '-l/opt/python/log/supervisord.log.*' -t publishlogs
+ /opt/elasticbeanstalk/bin/log-conf -nhttpd '-l/var/log/httpd/*' -f /opt/elasticbeanstalk/containerfiles/beanstalkhttpd
The above shows that Beanstalk configures logging for any of the following file:
- /opt/python/log/*
- /opt/python/log/app.out.*
- /opt/python/log/supervisord.log.*
- /var/log/httpd/*
That is, if you put a log file in /opt/python/log/
, Beanstalk will find it and present it when you "Request Logs." I put my log files in /opt/python/log/
because it is accessible by WSGI group (which runs my application). This would be slightly different if you were using the Ruby environment type by the way. You can still check eb-activity.log
for which directories are set up for logging.