Monitoring small deployments – logging and alerting
One of the nice things about starting small is that you may be able to rely on very simple mechanisms for both logging and alerting. For any deployment using Docker and Docker Compose
on a single host—for example, a deployment of ShipIt Clicker—you can use some basic tools and commands to deal with logging, and a variety of simple alerting services provided by third parties to deal with alerting.
Logging
For logging, in many cases, all that is required is to use the logs built into Docker. Docker captures the standard output and standard error file handles of every process it starts and makes them available as logs for each container. You can review the consolidated logs for all the services started since the last container restart with the following command, assuming you are in the directory where your docker-compose.yml
file is present (less -R
will interpret the ANSI color escapes that the logs
command...