Caddy Docker Image - how do I view logging information that Caddy is outputting about server status when running detached container?


Hello! I am just starting to try and integrate Docker into my workflow and I had a hopefully quick question for the more experienced Docker users out there, I was just curious about how to check the server logs when running a container in detached mode?

To clarify, when I say server logs, I’m talking about the output of messages relating to how Caddy is currently operating, basically what systemctl would spit out

At the moment I’m running the container normally(in and undetached mode) to try and get that information but it would be better if there was a log somewhere on the image I could examine or maybe something in Docker itself.


Gagh! never mind, I figured it out, it’s just docker logs <container name>


Just to tack on the end here - I’m a big fan of this one:

docker logs -f --tail 20 <container>

This works with Compose, too:

docker-compose logs -f --tail 20 <service>

These bring up the latest 20 log entries and then follow the logs so you can watch them in real time, this is my go to for debugging stuff.


Even better! Thanks for sharing!

This topic was automatically closed after 30 days. New replies are no longer allowed.