14. Collecting Container Logs
Overview
In the previous chapter, we made sure we were collecting metrics data for our running Docker containers and services. This chapter builds on this and dedicates itself to collecting and monitoring the logs for Docker containers and the applications running on them. It will start with a discussion of why we need to have a clear log monitoring strategy for our development projects and discuss some of the things we need to remember. We will then introduce the main player in our log monitoring strategy – that is, Splunk – to collect, visualize, and monitor our logs. We'll install Splunk, forward log data from our system and running containers, and use the Splunk query language to set up monitoring dashboards that work with the log data we've collected. By the end of this chapter, you will have the skills to set up a centralized log monitoring service for your Docker container project.