Skip to content

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.

Terminal window
docker logs -f --tail=100 my-app

For Compose:

Terminal window
docker compose logs -f my-app

For Kubernetes:

Terminal window
kubectl logs -f deploy/my-app

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.

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/push

For Kubernetes, use a node-level collector such as Promtail, Fluent Bit, or Vector — no per-pod configuration required.

Most applications expose a LOG_LEVEL (or similar) variable. See Environment Variables.