The log-capture option decides whether gopherd interposes on a child's
stdout/stderr. It is off by default: children write directly to the
container's stdout/stderr file descriptors and gopherd never touches their
output — no pipe, no per-line processing, zero CPU cost.
processes:
- name: raw
command: /bin/sh
args: ["-c", "echo raw-passthrough; sleep 300"]
on-failure: shutdown
- name: captured
command: /bin/sh
args: ["-c", "echo captured-line; sleep 300"]
on-failure: shutdown
log-capture: truelog-capture— global key sets the default for all processes; a per-process key overrides it (same shape aspass-env).- When false (default), capture-dependent features are unavailable for
that service:
prefixis ignored, log-targets receive nothing, andgopherd logs <svc>returnslog capture disabled. - When true, output flows through gopherd: prefixes,
gopherd logs, log-targets, and rotation all work.
rawwritesraw-passthroughstraight to gopherd's stdout FD — the line appears without any prefix.capturedis prefixed ([captured] <timestamp> captured-line) and queryable vialogs captured.logs rawfails withlog capture disabled for "raw" (set log-capture: true).
The test asserts the raw line appears un-prefixed in daemon output, the
captured line is returned by logs captured with its [captured] tag, and
logs raw returns the disabled error.
go test ./documentation/log-capture/ -v