Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I get the logs of a crashed service

I’m using docker compose to up a service. It crashes (I guess since it is supposed to run a server).

I tried

docker compose -f [my_docker_compose_file] logs

but it doesn’t say anything and shouldn’t but I can’t work around an other way to get the logs.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Question is, how do I retrieve the logs of the crashed service ?

>Solution :

List out all containers on your machine

docker container ls -a

The -a flag here is important – to include all stopped (e.g., crashed) containers in addition to those still up and running.

Find the container representing your service from this list – suppose it is called <my-container>. To see the logs of this container

docker container logs <my-container>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading