25th Anniversary Savings | 25% Off Dedicated Servers*Shop Now
25th Anniversary Savings | 25% Off VPS Hosting* †††Shop Now
Dedicated Hosting Deals | From $99/moShop Now
Earn hosting credits and a chance to win an Amazon gift card when you refer friends to Liquid Web!Read our promo rules
Reading Time: < 1 minute

 

Pre-Flight Check
  • As of June 2014 Docker has officially released v1.0.0.
  • These instructions are intended for viewing logs for Docker containers.
  • I’ll be working from a Liquid Web Core Managed CentOS 6.6 server (or CentOS 7, Ubuntu 14.04 LTS, Fedora 20, Fedora 21), and I’ll be logged in as root.

In the previous tutorials in this series we’ve installed Docker and got a container running, we listed which containers were running, and attached to a running Fedora container, and we’ve committed changes and created Docker images.

View Logs for a Docker Container

If you’re currently attached to a docker instance, then first disconnect (detach) from the shell without exiting use the escape sequence Ctrl-p + Ctrl-q.

To view the logs for a container it’s as simple as running just one command. Let’s take a look at the logs for container 2c9d5e12800e :

docker logs 2c9d5e12800e

If you don’t know the container ID, then use this tutorial on how to list docker containers.

Avatar for J. Mays

About the Author: J. Mays

As a previous contributor, JMays shares his insight with our Knowledge Base center. In our Knowledge Base, you'll be able to find how-to articles on Ubuntu, CentOS, Fedora and much more!

Latest Articles

How to Install Adminer MySQL Database Management Tool on AlmaLinux

Read Article

What is CGI-Bin and What Does it Do?

Read Article

Top 10 Password Security Standards

Read Article

Top 10 Password Security Standards

Read Article

How to Use the WP Toolkit to Secure and Update WordPress

Read Article