Goal
Centralize device logs on the Pi5 bridge so failures can be diagnosed after the fact without USB serial, and so multiple devices' logs sit side-by-side on one host.
Motivation
`Logger::logPrintf` writes to SD on-device, which survives reboot but requires:
- Pulling the SD card physically, OR
- Browsing the existing web-serial endpoint device-by-device
Centralized syslog-style ingestion solves both. Multiple devices' logs are queryable together. Standard ops pattern.
Proposed shape
- Bridge side: new endpoint `POST /api/device/log` accepting batched `{device_id, lines: [{ts, level, msg}, ...]}` JSON. Persists to a rotating log file (`/app/data/device-logs/.log`) or forwards to host syslog. Configurable retention.
- Device side: new module that subscribes to `Logger` output, buffers in a FreeRTOS queue (drop-oldest on overflow so it never blocks the logging caller), batches every N seconds OR M lines, POSTs to the bridge. Robust against transient network failures (drop or backpressure, don't crash).
- Failure mode: if bridge endpoint is down, queue fills to a cap and oldest entries get dropped. Device logs continue going to SD card uninterrupted. Centralization is best-effort, not gating.
Notes
- Both DCC devices (dcc-panel7, dcc-desk) and potentially other DW devices over time
- Should NOT block the calling task — logging must remain non-blocking
- Format compatible with standard syslog parsers preferred (RFC 5424-ish if cheap; otherwise plain JSONL)
Goal
Centralize device logs on the Pi5 bridge so failures can be diagnosed after the fact without USB serial, and so multiple devices' logs sit side-by-side on one host.
Motivation
`Logger::logPrintf` writes to SD on-device, which survives reboot but requires:
Centralized syslog-style ingestion solves both. Multiple devices' logs are queryable together. Standard ops pattern.
Proposed shape
Notes