Files
fips/docs/reference
Arjen 98786e527a feat(logging): let the daemon own and rotate its log file
The macOS package accumulated a single unbounded log file — 717 MB on a
node running at debug level. Nothing rotated it, and nothing could.

fips logs to stdout and leaves capture to the supervisor, which is right
where the platform rotates that stream: journald does, and so does syslog
under procd. launchd does not. It redirects stdout to a plain file and
appends to it forever, and the usual rename-and-signal rotators cannot
help, because launchd holds the descriptor and passes it as fd 1 — the
daemon has no way to reopen a file rotated out from under it, and
signalling it achieves nothing. Rotation therefore has to happen in the
process that writes, which means the daemon has to own the file.

`node.log_file` names it, and is unset by default so every platform whose
supervisor already rotates keeps logging to stdout exactly as before —
setting it there would only duplicate what journald and syslog hold.
`node.log_rotation` (hourly/daily/never, default daily) and
`node.log_max_files` (default 7) govern the roll. Both parse leniently in
the same way as `node.log_level`: a typo falls back to the default rather
than refusing to boot, and the resolved values are logged at startup.

Rotation is by period rather than by size, so `node.log_level` is what
actually governs volume — debug costs roughly an order of magnitude more
per day than info. Retention bounds the rest.

Writes go through a non-blocking appender, so a slow or full disk cannot
stall the tick loop behind a log write. The worker guard is held for the
lifetime of the daemon; dropping it would silently discard every line
logged afterward.

The live file carries the date the current period opened, since that is
how the appender names a rolled file. Splitting the configured path on its
extension rather than suffixing the whole name keeps `.log` on the end, so
`/var/log/fips/fips.log` is written as `fips.2026-08-31.log`. That does
mean the current file no longer has a fixed name; the packaged config
carries the `tail` incantation for it.

Opening the log is fatal on failure, matching how this binary treats an
unusable config. A daemon that silently dropped its logging because a
directory was unwritable would present as exactly the disappearing-logs
problem this exists to fix.

macOS packaging is the only one that turns this on. The plist stops
redirecting stdout and stderr, which would otherwise reintroduce the
unbounded file alongside the rotated one; the cost is that a failure
before logging initialises, and a panic, now go nowhere rather than to
fips.log. The setting is inserted after the `node:` key rather than
appended to the shared config, which ends at a top-level `peers:` key —
an appended block would land under the wrong mapping, and a second
top-level `node:` would collide with the first.
2026-08-31 09:36:50 +01:00
..
2026-08-30 10:42:59 +00:00
2026-08-30 10:42:59 +00:00

Reference

Information-oriented technical descriptions for lookup on demand. Reference content describes what is: wire formats, configuration keys, command-line flags, control-socket commands, default values, file paths, exit codes. It is consulted, not read end-to-end.

Reference is austere by design: minimal narrative, no opinions, no guidance on when to use a feature. The "why" lives in design/; the "how do I accomplish X" lives in how-to/.

Available Reference

Document Scope
wire-formats.md All FMP and FSP message byte layouts, encapsulation walkthrough
configuration.md Full YAML configuration reference for the daemon and gateway
security.md nftables baseline, peer ACL, cryptographic primitives, rekey defaults, threat-resistance matrix
nostr-events.md Kind 37195 advert, Kind 21059 traversal signaling, Kind 10050 inbox relays
transports.md Per-transport statistics counter inventory
control-socket.md Line-delimited JSON control protocol for the daemon and gateway
native-api.md Native datagram API: the Rust surface, addressing and ports, errno table, ceilings, line protocol, command reference
cli-fips.md fips daemon CLI: options, exit codes, environment, files
cli-fipsctl.md fipsctl control-client: subcommands, options, exit codes
cli-fipstop.md fipstop live-status TUI: tabs, keybindings
cli-fips-gateway.md fips-gateway service CLI: options, exit codes, files