Stream logs to a central server

Author:

Rohit Goswami

Overview

Serve mode lets multiple bless clients stream logs to a central server via Cap’n Proto RPC. The server writes per-session gzip files and maintains an index.

Requires building with the serve feature.

Build with serve support

cargo build --release --features serve

Start the server

bless --serve :5678

The server stores sessions in ~/.local/share/bless/sessions/.

Stream from a client

bless --remote :5678 --label ci-build -- make test

To also keep a local gzip file:

bless --remote :5678 --local --label ci-build -- make test

Session files

Each session produces:

  • {label}_{uuid}.log.gz – compressed log with timestamps

  • index.json – append-only JSONL with session metadata

Architecture

client                     server
  |                          |
  |-- openSession(meta) ---->|
  |<---- LogSink capability -|
  |                          |
  |-- writeBatch(lines) ---->|  (batched, every 64 lines or 100ms)
  |-- writeBatch(lines) ---->|
  |                          |
  |-- close(exit, dur) ----->|  (finalizes gzip, writes index)