I have a docker image through which I make an aws batch job definition. Within the docker I am printing some statements. The job runs and there's a success message. But the logs aren't there in Cloudwatch. It says that no events found. Not even the start and endtime of the job.
Cloudwatch logs
I have set up the environment variable ECS_AVAILABLE_LOGGING_DRIVERS = awslogs as well but I still don't see any logs.
What additional configuration are required ?
To view your CloudWatch Logs dataOpen the CloudWatch console at https://console.aws.amazon.com/cloudwatch/ . In the left navigation pane, choose Logs, Log groups. Choose a log group to view. Choose a log stream to view.
If CloudWatch logging is enabled for your task and you still can't view the logs, confirm that you have the required IAM role. Open the IAM console, and then choose Roles from the navigation pane. Confirm that dms-cloudwatch-logs-role is listed.
To configure your IAM role or user for CloudWatch LogsOpen the IAM console at https://console.aws.amazon.com/iam/ . In the navigation pane, choose Roles. Choose the role by selecting the role name (do not select the check box next to the name). Choose Attach Policies, Create Policy.
On the Logs/Tracing tab, under CloudWatch Settings, do the following to turn on execution logging: Choose the Enable CloudWatch Logs check box. For Log level, choose INFO to generate execution logs for all requests. Or, choose ERROR to generate execution logs only for requests to your API that result in an error.
For Using CloudWatch Logs with container instances you need the following:
the steps could be found here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With