-
Notifications
You must be signed in to change notification settings - Fork 0
Installation and First Run
- Go 1.25+ (only if you build from source)
- Read access to the directories where your applications write logs
- A working sink destination:
- Kafka broker and topic, or
- A writable path for a JSONL file, or
- An HTTP endpoint that accepts POST requests (open / no auth for the built-in
http-noauthsink)
git clone https://github.com/sanjuthomas/log-forwarder.git
cd log-forwarder
go mod download
go build -o bin/log-forwarder ./cmd/log-forwarderFor a typical Linux server:
GOOS=linux GOARCH=amd64 go build -o bin/log-forwarder ./cmd/log-forwarderBuild a binary with custom parsers, transformers, enrichers, or sinks (see Custom-Extensions):
go build -o bin/log-forwarder-custom ./examples/customAlways prefer an explicit config in production:
./bin/log-forwarder -config /etc/log-forwarder/config.yamlStart the process from a directory where relative paths in the config resolve correctly, or use absolute paths in YAML for watch paths, watermark file, and file sink output.
The forwarder logs to stderr and stops cleanly on SIGINT / SIGTERM.
Without -config, built-in defaults apply:
- Watches the current directory for
*.log*files - Kafka at
localhost:9092, topiclogs - Tab-delimited parsing
- Hostname enrichment
./bin/log-forwarderDefaults are convenient for a quick test; use a real config file for anything beyond local development.
-
Startup logs — look for:
-
sink connectivity verified— destination was reachable at startup -
log forwarder started— includes watch sources andsink_type
-
-
Write a test line to a watched file (adjust path/pattern to match your config):
mkdir -p logs/app echo "$(date -u +%Y-%m-%dT%H:%M:%SZ) info test message" >> logs/app/test.log
-
Check the sink:
- Kafka — consume the topic with your usual Kafka tools
-
File —
tail -fthe JSONL output path from config - HTTP — confirm your ingest service received the POST
-
Optional metrics — if
metrics.enabled: true, scrapehttp://<host>:<port>/metricsand checklog_forwarder_lines_published.
If the sink cannot be reached at startup (for example Kafka is down), the forwarder refuses to start:
sink unavailable at startup; refusing to start forwarder
Fix connectivity or config, then restart. This avoids silently running without a working destination.
- How It Works — pipeline overview
- Configuration Guide — YAML sections explained
- Example Configs — ready-made configs to copy
User guide
- Home
- Installation and First Run
- How It Works
- Filtering Vendor Noise
- Log Forwarder ATC
- Configuration Guide
- Configuration-Reference
- Config-Catalog
- Choosing a Sink
- Spring Boot Logs
- Watermarks and Restarts
- Built-in-Components
- Custom-Extensions
- Monitoring
- Testing
- Docker
- Deployment
- Example Configs
- Troubleshooting
Contributors