19 Writing and managing application logs with Docker

 

Logging is usually the most boring part of learning a new technology, but not so with Docker. The basic principle is simple: you need to make sure your application logs are being written to the standard output stream, because that’s where Docker looks for them. There are a couple of ways to achieve that, which we’ll cover in this chapter, and then the fun begins. Docker has a pluggable logging framework--you need to make sure your application logs are coming out from the container, and then Docker can send them to different places. That lets you build a powerful logging model, where the application logs from all your containers are sent to a central log store with a searchable UI on top of it--all using open source components, all running in containers.

19.1 Welcome to stderr and stdout!

19.2 Relaying logs from other sinks to stdout

19.3 Collecting and forwarding container logs

19.4 Managing your log output and collection

19.5 Understanding the container logging model

19.6 Lab