On this pageWhat a log stack actually does
SSHing into three servers to grep three sets of logs works until the night it does not: the interesting line was on the server you checked last, or it rotated away an hour ago. Centralized logging fixes both problems. For a small team the hard part is not the idea but the sizing, because the most famous stacks were designed for companies with dedicated platform teams. This guide compares the options that make sense for a few servers and ends with a setup you can run today.
What a log stack actually does
Every log platform, large or small, splits the work into the same stages:
- Collect. An agent on each host reads files, the systemd journal or container output.
- Ship. The agent batches, compresses and sends lines over the network, buffering when the receiver is down.
- Store and index. The backend writes the data and builds whatever index makes searching fast.
- Query and alert. A UI and a query language find lines; rules turn patterns into notifications.
- Expire. Retention deletes old data before the disk fills.
The backend choice drives everything else, so start there.
Four backends that fit a small setup
| Backend | License | Index approach | Query language and UI | Footprint |
|---|---|---|---|---|
| Grafana Loki | AGPL-3.0 | Labels only; log content is stored in compressed chunks | LogQL, through Grafana | Light, more pieces when scaled out |
| VictoriaLogs | Apache 2.0 | Stores every field, no index configuration up front | LogsQL, built-in web UI or Grafana plugin | One binary, light |
| Graylog Open | SSPL | Full-text, via OpenSearch | Graylog web UI with streams and pipelines | Graylog plus MongoDB plus a search node |
| OpenSearch | Apache 2.0 | Full-text inverted index | Query DSL and PPL, OpenSearch Dashboards | Heaviest; runs on the JVM |
Labels versus full-text indexes
Loki indexes only a small set of labels such as host, job or container. A query first narrows the search by label, then scans the matching chunks. That keeps storage cheap and ingestion simple, but a search across all logs for an arbitrary string has to read a lot of data. Keep label sets small: a label with thousands of values, such as a user ID, multiplies the number of streams and hurts performance.
OpenSearch and Graylog build a full-text index of every word. Ad hoc searches are fast, and dashboards can aggregate any field, but the index costs RAM and disk on top of the raw data. Graylog adds a polished interface for routing, parsing and alerting, at the price of running MongoDB and a search backend next to it. Note that Graylog Open uses the SSPL, which the OSI does not recognize as an open-source license; it matters mostly if you plan to offer log management as a service.
VictoriaLogs sits in between. It accepts any fields without a schema, groups lines into streams defined by a few stream fields, and is designed to run well on modest hardware. It ships as a single executable with a built-in web interface, which makes it the easiest of the four to operate.
A quick way to choose
- You already run Grafana and Prometheus: Loki keeps everything in one UI.
- You want the least moving parts on one small server: VictoriaLogs.
- Your team wants a full log management UI with parsing rules and alert definitions, and has RAM to spare: Graylog.
- You need heavy analytics, aggregations and long retention on large volumes: OpenSearch.
Shipping the logs
The shipper matters as much as the backend, because it is the part running on every server.
| Shipper | License | Notes |
|---|---|---|
| Grafana Alloy | Apache 2.0 | Grafana's collector; Promtail reached end of life on March 2, 2026, and alloy convert migrates its configs |
| Vector | MPL-2.0 | Has its own transformation language and sinks for Loki, Elasticsearch-compatible APIs and more |
| Fluent Bit | Apache 2.0 | Very small footprint, common in container setups |
| systemd-journal-upload | Part of systemd | No extra agent if your logs already go to journald |
If you still run Promtail, plan the move to Alloy or another client now: it no longer receives fixes.
Size retention before you deploy
Measure your real volume instead of guessing. On each server, check how much text a day produces:
sudo journalctl --since "24 hours ago" | wc -c # bytes of journal text per day
sudo du -sh /var/lib/docker/containers # container logs on disk
Multiply the daily figure by the number of servers and the days you want to keep. All four backends compress data, so stored size ends up well below raw size, but the ratio depends on how repetitive your logs are. Start with a retention you can afford, watch real disk usage for a week, then adjust. Always set an explicit retention: a log server that fills its own disk stops accepting the very logs you need during an incident.
A working setup: journald to VictoriaLogs
This design uses no custom agent. Each host's services and containers log to the systemd journal, and the standard systemd-journal-upload client forwards the journal to VictoriaLogs.
On the log server, run VictoriaLogs with Docker Compose. Bind the port to the server's private or WireGuard address, not the public one, because VictoriaLogs is meant to sit behind a private network or an authenticating proxy:
services:
victorialogs:
image: victoriametrics/victoria-logs:v1.54.0
command:
- -storageDataPath=/vlogs
- -retentionPeriod=30d
ports:
- "10.8.0.1:9428:9428"
volumes:
- vlogs:/vlogs
restart: unless-stopped
volumes:
vlogs:
The default retention is seven days, so the -retentionPeriod flag is the one setting you should always choose consciously.
On each client server, install the uploader and point it at the backend:
sudo apt install systemd-journal-remote
sudo tee /etc/systemd/journal-upload.conf <<'EOF'
[Upload]
URL=http://10.8.0.1:9428/insert/journald
EOF
sudo systemctl enable --now systemd-journal-upload
To include Docker containers, set the journald logging driver for them, as explained in the Compose logs guide. Their output then travels the same path with container names attached.
Open the web UI at http://10.8.0.1:9428/select/vmui/ from a machine on the private network, or through a reverse proxy with authentication. A first LogsQL query that filters one host and one word looks like this:
_time:1h _HOSTNAME:"web-01" error
For alerts, VictoriaMetrics' vmalert can evaluate LogsQL rules on a schedule, and Grafana can query VictoriaLogs through its data source plugin. To avoid installing it by hand, deploy the VictoriaLogs app from CloudSat's one-click catalog instead.
Habits that make central logs useful
- Log structured data. One JSON object per line with
level,msgand a request ID turns searches into exact filters. - Keep secrets out. Tokens and passwords in logs become a second, less protected copy of your credentials. Mask them in the application or in the shipper.
- Synchronize clocks. Correlating events across hosts only works if every server runs NTP;
timedatectlshows whether it is active. - Watch the pipeline itself. Alert when a host stops sending logs. Silence is often the first symptom of an outage.
FAQ
Can I start with one server for both apps and logs?
Yes, for testing. In production, put the log backend on its own small server so a misbehaving application cannot take its own evidence down with it.
Do I need Kafka or a message queue in front?
Not at this scale. Shippers such as Vector, Alloy and Fluent Bit buffer locally while the backend is unreachable. Queues help when ingestion bursts exceed what the backend can absorb, which is rare with a few servers.
Is syslog still worth using?
Yes, for network devices and appliances that only speak syslog. VictoriaLogs, Graylog and the common shippers accept syslog input, so those devices can feed the same backend as your servers.
Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.




