Logging
Our containers follow the 12-factor convention: every process logs to stdout and stderr, and the runtime decides what to do with those streams.
Reading Logs
Section titled “Reading Logs”docker logs -f --tail=100 my-appFor Compose:
docker compose logs -f my-appFor Kubernetes:
kubectl logs -f deploy/my-appRotation
Section titled “Rotation”By default Docker uses the json-file driver with no rotation — logs grow forever. Configure rotation in /etc/docker/daemon.json:
{ "log-driver": "json-file", "log-opts": { "max-size": "10m", "max-file": "3" }}Restart the Docker daemon for changes to take effect.
Shipping Logs Centrally
Section titled “Shipping Logs Centrally”Set a different log driver per service to ship logs to Loki, Splunk, or syslog:
services: my-app: image: ghcr.io/trueforge-org/my-app:latest logging: driver: loki options: loki-url: http://loki:3100/loki/api/v1/pushFor Kubernetes, use a node-level collector such as Promtail, Fluent Bit, or Vector — no per-pod configuration required.
Log Levels
Section titled “Log Levels”Most applications expose a LOG_LEVEL (or similar) variable. See Environment Variables.