How do I add logs to CloudWatch?
Also, how do I set up CloudWatch logs?
Configuration for sending OS logs to CloudWatch involves,
- Create IAM Role with relevant permission and attach to Linux instance.
- Install the CloudWatch agent in the instance.
- Prepare the configuration file in the instance.
- Start the CloudWatch agent service in the instance.
- Monitor the logs using CloudWatch web console.
Considering this, how do I send Docker logs to CloudWatch?
Go through the following steps to send your first log message from your container to CloudWatch Logs.
- Open CloudWatch Logs in the Management Console.
- Create a log group name docker-logs .
- Go to IAM and create a role for the use with EC2 named docker-logs and attach the CloudWatchLogsFullAccess policy.
Login to the AWS console and navigate to the CloudWatch Service. Once you're in the CloudWatch console go to Logs in the menu and then highlight the CloudTrail log group. After that you can click the “Create Metric Filter” button. In the “Filter Pattern” box we'll select a pattern that we're looking for.