There are a few ways of monitoring the running Docker containers. They includes viewing the log files, looking at the container events and statistics, and also inspecting container properties. Let's begin with the logging. Docker has powerful logging features. An access to the log entries is crucial, especially if you have your container running in the detached runtime mode. Let's see what Docker can offer when it comes to a logging mechanism.
Most applications output their log entries to the standard stdout
stream (normally you just see in in the console when you run the application). However, when running from Docker in detached mode, we see nothing on the console because the container runs in the background. To view the log entries from the container, execute the following command:
docker logs -f <container name>
The -f
flag acts as the same flag in Linux tail
command; it will continuously display new log entries on the console. When you are done...