Compose: docker-compose logs does not re-follow logs for restarted containers

Created on 9 Feb 2016  路  4Comments  路  Source: docker/compose

If you follow the logs in one window, and then kill and restart a container in another, then the first window will no longer get the logs of the (now running again) container. This is only an issue recently, since the addition of the (very useful) behaviour of not terminating the docker-compose logs command on termination of a single container. However, not re-following restarted containers means that a large number of people using this feature will run into the same thing that I did and be stumped for a while - probably blaming their own code. I think that this is the other half of that new behaviour, because without it you just have to kill and restart the docker-compose logs command anyways.

arelogs duplicate

Most helpful comment

I don't think #1115 fixed this - I've just added some debug facilities to a container that makes it 'terminate' with an error when it detects code changes, but I have to restart the log tail still in Docker Compose 1.8.0 to see the logs of the restarted container.

All 4 comments

Thanks for the bug report!

This is indeed an issue, we're tracking it in #1115

I don't think #1115 fixed this - I've just added some debug facilities to a container that makes it 'terminate' with an error when it detects code changes, but I have to restart the log tail still in Docker Compose 1.8.0 to see the logs of the restarted container.

+1

Indeed I confirm this is not working on:

docker-compose version 1.25.5, build unknown
docker-py version: 4.2.2
CPython version: 3.7.6
OpenSSL version: OpenSSL 1.1.1g  21 Apr 2020
Was this page helpful?
0 / 5 - 0 ratings