简体   繁体   中英

configured logging driver does not support reading : Docker

I am running my docker container in AWS ECS. When i try to execute the below command to read the logs from container, i am facing the below error.

command: docker logs -f "Container ID"

Error response from daemon: configured logging driver does not support reading.

Any feasible solutions are welcome.

According to information commented by David Maze, you must have your container run with a awslogs log driver.

Here is the setting introduction.

After changing log driver to json-file, you could get log by executing docker logs container-id/name .

But still note this:

If using the Fargate launch type, the only supported value is awslogs.

You are using awslogs log-driver, and docker logs command is not available for that driver.

From the docs:

The docker logs command is not available for drivers other than json-file and journald

limitations of logging drivers

I have had this same issue before.

In my specific case the Task Definition for that service in ECS had the Log Configuration's logDriver set to fluentd see the circled image below.

在此处输入图片说明

To resolve the issue, I created another Task Definition with all the same parameters except I left the Log Configuration section's Log Driver to default . note if you click on that you'll see other log drivers including fluentd .

After that I pointed the service to this task definition in my ECS cluster, and now I can see the logs doing the commands docker logs <container id>

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM