Page History
...
Code Block |
---|
{ "agent": { "run_as_user": "root" }, "logs": { "logs_collected": { "files": { "collect_list": [ { "file_path": "/var/log/apache2scheduler/error.log", "log_group_name": "apachescheduler-error-log", "log_stream_name": "{instance_id}" } ] } } } } |
...
Code Block |
---|
$ sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json -s |
View Logs
From the CloudWatch Overview, the user must select Logs from the menu. In the Logs, the user will able to find the label for the Log Group created in the config. Here, select the log group name to see the Log Streams. Click on the Log Stream uses the EC2 instance ID, so the user knows in which EC2 instance the data is logged.
Overview
Content Tools