With log-capture: true, gopherd keeps a ring buffer of each service's
recent output and can stream new lines live over the control socket:
gopherd logs ticker # recent history, then exit
gopherd logs ticker -f # follow live output (Ctrl-C to stop)log-capture: true
processes:
- name: ticker
command: /bin/sh
args: ["-c", "i=0; while true; do i=$((i+1)); echo tick $i; sleep 0.2; done"]
on-failure: shutdownlog-capture: trueis required — with the default direct FD passthrough gopherd never sees the output, andlogsreturns an explicit error for that service.- Without
-fthe command prints the ring-buffer history and exits; with-fit first prints the history, then streams every new line as the service writes it. - Streaming connections have their own pool (separate from one-shot
commands), so followers cannot starve
status/start/stop. - Lines carry the configured prefix (service name + timestamp by default).
gopherd logs tickerreturns lines like[ticker] ... tick 42.gopherd logs ticker -fkeeps printing a newtick Nevery 200ms until interrupted.
Run level. The test fetches history over the control socket and asserts it contains tick lines, then opens a raw follow stream and asserts multiple new lines arrive live. SIGTERM then yields a clean exit 0.
go test ./documentation/log-streaming/ -v