Configuring CloudWatch Logs with Elastic Beanstalk
You can configure your AWS Elastic Beanstalk environment to stream Amazon CloudWatch (CloudWatch) logs from Amazon EC2 instances created by Elastic Beanstalk.
When you configure CloudWatch logs, Elastic Beanstalk creates CloudWatch log groups for proxy and deployment logs on the Amazon EC2 instances and transfers these log files to CloudWatch logs in real time.
Configuring CloudWatch logs in the Elastic Beanstalk console
The Elastic Beanstalk console contains three settings:
Whether to enable streaming CloudWatch logs
Whether to delete the log groups when the environment is terminated
The number of days to keep log events before they expire
Use the options in the aws:elasticbeanstalk:cw:logs namespace to configure CloudWatch logs. These options can be set by using configuration files, a CLI or an SDK.
StreamLogs – Set this option to
true to create groups in
CloudWatch logs for proxy and deployment logs, and stream logs from each instance in your
DeleteOnTerminate – Set this option to
true to delete the
log groups when the environment is terminated. If
false, the logs are kept
RetentionInDays – Set this option to the number of days to keep log
events before they expire.