liveBook · Manning

Log driver

As explained in Logs and Telemetry

A logging driver is a container-runtime component that routes container log output to a selected logging destination or backend.

A log driver is a container-runtime component that captures a container’s stdout and stderr streams and routes them to a configured destination or backend. It can reduce extraction effort, support routing, and preserve container context such as IDs, names, and output sources. section 4.5 section 4.11

Choose the driver and collection path according to the runtime and deployment environment:

  • Use Docker’s Fluentd logging driver to send events using the forward protocol to Fluent Bit. section 4.5
  • Expect Podman to default to journald; collect those records with Fluent Bit’s systemd plugin. section 4.5
  • Fall back to a known accessible file when the runtime cannot use a Fluentd or Fluent Bit-compatible driver. section 4.5
  • Treat Kubernetes logging as runtime-dependent: cluster-wide collection commonly uses a sidecar or a node-level agent such as a DaemonSet. section 4.7.1

Send Docker logs to Fluent Bit

Configure Fluent Bit with a forward input on port 24224 and a stdout output, start it with `fluent-bit -c ./fluentbit/docker-log-driver-out.conf`, then run `docker run --log-driver=fluentd --log-opt fluentd-address=localhost:24224 hello-world`. The console receives log records containing fields such as `container_id`, `container_name`, `source`, and `log`. section 4.5

Listing 4.3 Receiving Docker log events: docker-log-driver-out.conf
[SERVICE]
  flush 1

[INPUT]
  name forward     #1
  port 24224
  listen 0.0.0.0

[OUTPUT]        #2
  name stdout
  match *

Inspect the minimal Fluent Bit configuration that receives Docker forward events and writes every record to stdout. section 4.5

How Logs and Telemetry covers it

How deep it goes
Explains capture semantics, runtime differences, protocol configuration, output fields, and Kubernetes deployment choices without detailing driver internals.
Examples
Demonstrates Docker Hello World logs sent to Fluent Bit through a forward input and displayed with container metadata.
What it assumes
Assumes basic container-runtime and Fluent Bit familiarity while establishing stdout, stderr, drivers, and runtime-specific collection paths.
What you can do after
Apply it via Docker and Fluent Bit configuration to route container output and verify received records.
How it connects
Connects container runtimes, stdout and stderr, Fluent Bit, Fluentd, the forward protocol, journald, Kubernetes agents, sidecars, and DaemonSets.

Also explained in

Compare how 2 books explain log driver →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Logs and Telemetry. The section links point to the parts of the book it draws on.