Interview Prep/Docker/Limits, logging, health checks and restarts

Ship container logs to a central system.

IntermediateScenarioLimits, logging, health checks and restarts
Answer

Situation read → Hosts are ephemeral, logs must be centralised.

What I'd do → Options: run a collector (Fluent Bit, Vector, Promtail/Alloy) tailing /var/lib/docker/containers/*/*-json.log with Docker metadata; or use a driver (fluentd, gelf, awslogs, loki plugin). Collector approach is more resilient because blocking drivers can stall the app.

Why → The default blocking log mode can slow the app if the remote is down; set mode=non-blocking with max-buffer-size.

Interview tip → Structured JSON logs make queries easy.

All Docker questions Roadmap: Docker & containers

More on Limits, logging, health checks and restarts