/etc/docker/daemon.json
:
{
"log-driver": "awslogs",
"log-opts": {
"awslogs-region": "eu-west-2"
}
}
myservice:
logging:
driver: awslogs
options:
awslogs-region: eu-west-2
docker run \
--log-driver=awslogs \
--log-opt awslogs-region=eu-west-2 \
--log-opt awslogs-group=myLogGroup \
--log-opt awslogs-stream=myContainerNameOrOmitForContainerId \
--log-opt awslogs-create-group=true \
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"logs:CreateLogStream",
"logs:CreateLogGroup",
"logs:PutLogEvents"
],
"Effect": "Allow",
"Resource": "arn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName}/*"
}
]
}