Docker
Forward container logs to LogFlow using the HTTP log driver or a sidecar collector.
Option 1 â HTTP log driver (simplest)
Docker's built-in gelf and splunk drivers don't support LogFlow directly, but the fluentd driver with a Fluent Bit sidecar does. The simplest approach is the HTTP log driver via a forwarder.
For a zero-dependency setup, instrument your app directly with one of the language SDKs (node, python, go, etc.) and log to LogFlow from inside the container.
Option 2 â Fluent Bit sidecar (recommended for production)
Fluent Bit reads stdout/stderr from your containers and forwards them to LogFlow via HTTP.
1. Create fluent-bit.conf
[SERVICE]
Flush 2
Log_Level warn
[INPUT]
Name forward
Listen 0.0.0.0
Port 24224
[OUTPUT]
Name http
Match *
Host api.getlogflow.com
Port 443
TLS On
URI /v1/logs/batch
Format json
Header Authorization Bearer lf_YOUR_API_KEY
Header Content-Type application/json
json_date_key timestamp
json_date_format iso86012. docker-compose.yml
version: '3.8'
services:
app:
image: your-app:latest
logging:
driver: fluentd
options:
fluentd-address: localhost:24224
tag: app.{{.Name}}
environment:
- NODE_ENV=production
fluent-bit:
image: fluent/fluent-bit:3
volumes:
- ./fluent-bit.conf:/fluent-bit/etc/fluent-bit.conf:ro
ports:
- "24224:24224"
restart: unless-stoppedLOGFLOW_API_KEY as an environment variable and reference it in fluent-bit.conf with ${LOGFLOW_API_KEY} so the key never appears in your config file.Option 3 â Direct from Dockerfile
For simple single-container apps, send logs from your app code without any sidecar:
FROM node:22-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
# API key injected at runtime, not baked in
ENV LOGFLOW_API_KEY=""
ENV NODE_ENV=production
CMD ["node", "server.js"]# Run with API key from environment
docker run \
-e LOGFLOW_API_KEY=lf_YOUR_API_KEY \
-p 3000:3000 \
your-app:latestOption 4 â Kubernetes with Fluent Bit DaemonSet
For Kubernetes clusters, deploy Fluent Bit as a DaemonSet to collect logs from all pods:
# fluent-bit-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: fluent-bit-config
namespace: logging
data:
fluent-bit.conf: |
[SERVICE]
Flush 5
Log_Level warn
[INPUT]
Name tail
Path /var/log/containers/*.log
Parser docker
Tag kube.*
Refresh_Interval 5
[OUTPUT]
Name http
Match *
Host api.getlogflow.com
Port 443
TLS On
URI /v1/logs/batch
Format json
Header Authorization Bearer ${LOGFLOW_API_KEY}
Header Content-Type application/jsonvalueFrom.secretKeyRef in the DaemonSet spec â never hardcode it in ConfigMaps.Useful attributes to add
Enrich your logs with container metadata via Fluent Bit's Kubernetes filter:
[FILTER]
Name kubernetes
Match kube.*
Kube_URL https://kubernetes.default.svc:443
Merge_Log On
K8S-Logging.Parser On