The Logger is an async channel-based writer that emits both console output and binary segment files. It is shared across Runtimes through their Context.
Log Entry Model
Each log record is:
timestamp: u64(unix seconds)level: LogLevel(trace,debug,info,warn,error,fatal)target: Stringmessage: Stringfields: HashMap<String, String>
Runtimes/orchestrators log through LogHandle::log(...).
Logger Config
LogConfig fields:
dirflush_intervalsegment_max_bytes
Default config:
- dir:
/var/log/rind - flush interval:
250ms - segment max:
16 MiB
Write Pipeline
start_loggercreates channel + logger thread.- logger thread receives
LogEntrywith timeout. - each entry is printed to stdout in formatted text.
- each entry is encoded and appended to current
.rlogsegment. - writer flushes and rotates segment on size threshold.
RLOG Record Format
Per-record binary format:
- magic
u32=0x524C4F47(RLOG) - total_len
u32 - payload_len
u32 - payload (bincode of
LogEntry) - crc32
u32(payload)
Segment files are named like 00000001.rlog.
Fallback Behavior
If segment open fails in configured directory:
- logger falls back to
/var/log/rind-fallback.rlog.