Launch EC2 instance as ROOT
Edit the /etc/awslogs/awslogs.conf file and add the following.
Edit the /etc/awslogs/awslogs.conf file and add the following.
- sudo yum update -y
- sudo yum install -y awslogs
- vim /etc/awslogs/awscli.conf
- sudo service awslogs start
- sudo chkconfig awslogs on
vim /etc/awslogs/awslogs.conf
[/var/log/httpd/error_log]
datetime_format = %b %d %H:%M:%S
file = /var/log/httpd/error_log
buffer_duration = 5000
log_stream_name = {instance_id}
initial_position = start_of_file
log_group_name =
/var/log/httpd/error_log
[/var/log/httpd/access_log]
datetime_format = %b %d %H:%M:%S
file = /var/log/httpd/access_log
buffer_duration = 5000
log_stream_name = {instance_id}
initial_position = start_of_file
log_group_name =
/var/log/httpd/access_log
[/var/log/httpd/ssl_access_log]
datetime_format = %b %d %H:%M:%S
file =
/var/log/httpd/ssl_access_log
buffer_duration = 5000
log_stream_name = {instance_id}
initial_position = start_of_file
log_group_name =
/var/log/httpd/ssl_access_log
- Restart the awslogsd
service
service awslogsd restart
No comments:
Post a Comment