Skip to content
Martin Gergeleit edited this page Mar 9, 2026 · 1 revision

Syslog

The router can forward all ESP log output to a remote syslog server via UDP. Log messages are sent in RFC 3164 (BSD syslog) format. Serial console output is always preserved regardless of syslog configuration.

Enabling Syslog

syslog enable <server> [<port>]

Examples:

syslog enable 192.168.4.100          # Default port 514
syslog enable syslog.local 1514      # Custom port

Disabling Syslog

syslog disable

Checking Status

syslog status

Message Format

Messages are sent as RFC 3164 BSD syslog over UDP:

<134>Mar  9 14:23:01 myrouter I (12345) wifi: connected to AP
Field Description
<134> Priority (facility LOCAL0 + severity)
Mar 9 14:23:01 Timestamp from SNTP
myrouter Configured hostname (falls back to ESP32)
I (12345) wifi: ... Log message with ANSI codes stripped

Log Level Mapping

ESP Level Syslog Severity
E (Error) err (3)
W (Warning) warning (4)
I (Info) info (6)
D (Debug) debug (7)
V (Verbose) debug (7)

Timezone

Syslog timestamps use the system timezone. Set it with:

set_tz CET-1CEST,M3.5.0/2,M10.5.0/3

See Timezone for details and common timezone strings.

Testing Without a Syslog Server

You don't need a full syslog daemon to test. Just listen for UDP packets with netcat:

nc -u -l 514

If port 514 requires root, use a higher port:

nc -u -l 5140

Then configure the router:

syslog enable <your-pc-ip> 5140

Every log line from the ESP32 will appear directly in your terminal.

Configuration

All settings are persisted in NVS and survive reboots.

Setting NVS Key Description
Enabled syslog_en Enable/disable flag
Server syslog_srv Server hostname or IP (max 64 chars)
Port syslog_port UDP port (default 514)

Notes

  • Syslog packets are only sent when the STA interface is connected
  • UDP is fire-and-forget (no delivery guarantee, no retransmission)
  • DNS hostnames are resolved on first use after connectivity is established
  • The syslog socket is non-blocking to avoid stalling the log output path

Clone this wiki locally