LoginSignup
4

More than 5 years have passed since last update.

nginxのエラーログをcloudwatch logsに送信する

Posted at

nginxのエラーログをcloudwatch logsに送信する

awslogs install

 sudo yum install -y awslogs

awslogs.conf修正

/etc/awslogs/awslogs.conf
[/var/log/nginx/access.log]
log_group_name = nginx-error_log
log_stream_name = {instance_id}
file = /var/log/nginx/error.log
datetime_format = %Y-%m-%d %H:%M:%S,%3N
initial_position = start_of_file
buffer_duration = 5000

awscli.conf修正

/etc/awslogs/awscli.conf
[plugins]
cwlogs = cwlogs
[default]
region = ap-northeast-1

awslogs起動

  sudo service awslogs start

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4