Reputation: 4313
If you run docker-compose logs -f service
in one terminal and try to restart service
in other, then logging will be stopped and you will need to start dkc logs
again. How to keep dkc logs
running?
The only solution I've found so far is to run additional noop service which will not allow dkc logs
to shut down. If this is the only solution then do you have any suggestion for simplest noop
service which already exists on docker hub?
noop
service to the docker-compose.override.yml
(I picked redis because it was already installed and is quite lightweight):services:
noop:
image: redis:5-alpine
docker-compose logs -f service noop
instead of with just service
. docker-compose stop/restart service
. logs
process will be kept alive by noop
service.Con:
dkc stop
and dkc restart
without specifying the serviceUpvotes: 6
Views: 1632
Reputation: 71
Maybe some information about what you are logging. For example on nginx or php containers we simply move logfiles outside of container just using volume to mount them to host machine, then you can parse them as you want.
volumes:
- /var/log/mysql/error_service_xy.log:/var/log/mysql/error.log
Upvotes: 1