Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Aws Batch not logging to Cloudwatch

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 ?

like image 380
Piyush Dugar Avatar asked Aug 17 '18 21:08

Piyush Dugar


People also ask

How do I check AWS batch job logs?

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.

Why does log data not appear in CloudWatch logs?

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.

How do I push logs into CloudWatch?

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.

How do I enable CloudWatch logging?

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.


1 Answers

For Using CloudWatch Logs with container instances you need the following:

  • CloudWatch Logs IAM Policy
  • Installing and configuring the CloudWatch agent on your Container

the steps could be found here

like image 82
LinPy Avatar answered Sep 27 '22 01:09

LinPy