Skip to content

RaftLogManagerSysMod

Rob Dobson edited this page May 3, 2026 · 1 revision

LogManager SysMod

Built-in SysMod that routes Raft log output (LOG_I, LOG_W, LOG_E, ...) to one or more remote destinations and exposes runtime control via the log REST endpoint.

Source: RaftSysMods/components/LogManager/

What it provides

  • Configurable per-destination logging with rate-limiting and level control.
  • Three built-in destination types:
    • RaftRemote — POSTs log lines to a Raft-aware HTTP endpoint
    • Papertrail — UDP to Papertrail
    • Loki — Grafana Loki HTTP push API
  • Live enable/disable, level changes, and statistics through the log REST endpoint.

SysType configuration

{
    "name": "LogManager",
    "logDests": [
        {
            "type": "Loki",
            "name": "loki1",
            "enable": 1,
            "host": "logs.example.com",
            "port": 443,
            "user": "...",
            "key": "...",
            "level": "I"
        },
        {
            "type": "Papertrail",
            "name": "pt1",
            "enable": 1,
            "host": "logs.papertrailapp.com",
            "port": 12345,
            "level": "W"
        }
    ]
}

logDests is an array; each entry must have at least type, name, enable. The other fields depend on the destination type — see the matching Logger* class in the source for details.

Common fields supported by most destinations:

Key Meaning
level Min level: V D I W E (matches ESP IDF log levels)
maxcount Rate-limit cap per window
windowms Rate-limit window in ms
bufsize Internal buffer size

REST endpoints exposed

log returns/updates logger state:

Form Effect
log List all configured loggers + status
log/enable/<name> Enable a logger
log/disable/<name> Disable a logger
log/disconnect/<name> Close current connection (forces reconnect)
log/config/<name>?level=&maxcount=&windowms=&bufsize= Update parameters at runtime

Related

Clone this wiki locally