Docker Community Forums

Share and learn in the Docker community.

Consolidated Cloudwatch logs for docker

Expected behavior Folks I am currently trying to consolidate the cloudwatch log stream in 1 file.

Actual behavior

Today every time there is new instance of the docker it creates a new cloudwatch log stream. I want it to always use the same logstream - so even when your docker instance is updated or new one created it should use the same original log stream

{
“AWSEBDockerrunVersion”: 2,
“containerDefinitions”: [{
“name”: “ABC-backend”,
“image”: “somelinkhere/ABC-backend:<>”,
“memoryReservation”: 3840,
“essential”: true,
“portMappings”: [{
“containerPort”: 3001,
“hostPort”: 3001
}],
“logConfiguration”: {
“logDriver”: “awslogs”,
“options”: {
“awslogs-group”: “ABC-<>/ABC-backend”,
“awslogs-region”: “us-east-2”,
“awslogs-stream-prefix”: “ABC-backend”,
“awslogs-create-group”: true
}
}
}

However this creates a new stream every time we have a new instance.

Additional Information

Steps to reproduce the behavior