Collect logs from all containers and forward to stdout, files, or Loki
1.5K
Lightweight container log aggregator. Collects logs from all running containers and forwards them to stdout, files, or Loki.
Docker logs are scattered across containers. This image collects them all into one stream, making it easy to pipe into any log system or just watch everything in one place.
services:
docker-log:
image: zachbg/docker-log:latest
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
LOG_FORMAT: json
| Variable | Default | Description |
|---|---|---|
LOG_DRIVER | stdout | Output driver: stdout, file, loki, both |
LOG_FORMAT | json | Format: json or text |
LOKI_URL | Loki push URL (e.g., http://loki:3100) | |
LOKI_LABELS | job=docker | Extra Loki labels |
FILE_PATH | /logs | Path for file driver output |
INCLUDE_LABELS | Only watch containers with these labels (comma-separated) | |
EXCLUDE_CONTAINERS | Skip these container names (comma-separated) | |
SINCE | 5m | How far back to start collecting |
FOLLOW | true | Follow logs in real-time |
services:
docker-log:
image: zachbg/docker-log:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
LOG_DRIVER: loki
LOKI_URL: http://loki:3100
LOKI_LABELS: "job=docker,env=prod"
services:
docker-log:
image: zachbg/docker-log:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./logs:/logs
environment:
LOG_DRIVER: file
LOG_FORMAT: text
services:
docker-log:
image: zachbg/docker-log:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
INCLUDE_LABELS: "app=web,logging=enabled"
EXCLUDE_CONTAINERS: "docker-log,monitoring"
Content type
Image
Digest
sha256:dee970895…
Size
16.7 MB
Last updated
6 months ago
docker pull zachbg/docker-log