From the course: Certified Kubernetes Application Developer (CKAD) Cert Prep

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Container logging

Container logging

- This lesson is about finding out what the container is doing. Now the thing is that containers by default don't connect to a standard out. You want to run them in the background, like service processes that you are running on a regular computer. But if they are running in the background, how do you see the output that is generated by the primary application? Well by default you don't. But there is a very elegant solution to show it anyway, and that is the container log. The container log is actually a file that is stored in the directory created for every single container that contains the application output. The standard output, as well as the standard error. And you can use the docker logs command on a container to see the logs for that specific container. Let me show you. So I'm using Docker run minus minus name is my DB, Maria db. In this case, I could have used minus D again to run it as a detached container, but I'm expecting it to fail anyway. And as it is failing, well, I'm…

Contents