Languages
[Edit]
EN

docker-compose - show current logs of all docker services

1 points
Created by:
Violet-Hoffman
652

Hi, today I would like to share with you how to view current logs of all docker services started with docker-compose.

In order to show all current logs run this command in directory with docker-compose.yml:

docker-compose logs -t -f --tail 10

This command will show us last 10 lines of logs from each docker container.

If we have 3 docker containers configured in docker-compose with this command we will see 30 lines of logs, 10 lines of logs from each docker container.

https://docs.docker.com/compose/reference/logs/

Usage: logs [options] [SERVICE...]

Options:
    --no-color          Produce monochrome output.
    -f, --follow        Follow log output.
    -t, --timestamps    Show timestamps.
    --tail="all"        Number of lines to show from the end of the logs
                        for each container.

 

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Docker - useful wiki posts

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join