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.
To configure the Docker daemon to default to a specific logging driver, set the value of log-driver to the name of the logging driver in the daemon. json configuration file. Refer to the “daemon configuration file” section in the dockerd reference manual for details.
Docker daemon logs are generated by the Docker platform and located on the host. Depending on the host operating system, daemon logs are written to the system's logging service or to a log file. If you were to collect only container logs you'd get insight into the state of your services.
To use the json-file driver as the default logging driver, set the log-driver and log-opts keys to appropriate values in the daemon. json file, which is located in /etc/docker/ on Linux hosts or C:\ProgramData\docker\config\ on Windows Server. If the file does not exist, create it first.
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.
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