.ebextentions/awslogs.config
packages: yum: awslogs: [] container_commands: 01-replace-awscli_conf: command: cp -rf .ebextensions/awscli.conf /etc/awslogs/awscli.conf 02-replace-awslogs_conf: command: cp -rf .ebextensions/awslogs.conf /etc/awslogs/awslogs.conf 03-chkconfig-awslogs: command: /sbin/chkconfig awslogs on 04-restert-awslogs: command: /sbin/service awslogs restart
.ebextentions/awslogs.conf
[general] state_file = /var/lib/awslogs/agent-state [/var/log/messages] datetime_format = %b %d %H:%M:%S file = /var/log/messages buffer_duration = 5000 log_stream_name = {instance_id} initial_position = start_of_file log_group_name = /var/log/messages [/var/log/tomcat7/all] datetime_format = %Y-%m-%d %H:%M:%S file = /var/log/tomcat7/all.log* buffer_duration = 5000 log_stream_name = {instance_id} initial_position = start_of_file log_group_name = /var/log/tomcat7/all.log
.ebextentions/awscli.conf
[plugins] cwlogs = cwlogs [default] region = ap-northeast-1