Show Docker container logs
Written by Guillermo Garron
Date: 2020-07-20 15:15:32 00:00
If you need to check the logs of a Docker compose created container, just go to the folder where the docker-compose.yml
file is and run these commands.
docker-compose ps
That will have an output like this:
Name Command State Ports
----------------------------------------------------------------------------------------------------------------------------------------------------
mail supervisord -c /etc/superv ... Up 110/tcp, 143/tcp, 0.0.0.0:25->25/tcp, 4190/tcp, 0.0.0.0:465->465/tcp, 0.0.0.0:587->587/tcp, 993/tcp,
995/tcp
Now we know the container name, (mail in this case)
So we can run:
docker-compose logs mail
Or:
docker-compose -f logs mail