Step 5 (syslog): esp_log to remote syslog
- aes67_syslog: esp_log_set_vprintf hook chained to the UART; formats into a static buffer under a zero-timeout mutex (drop and count when busy), strips ANSI codes, parses level/tag, filters by log.level and queues (48 messages, non-blocking). Low-priority sender task: RFC 5424 (<PRI>1 - HOST APP - - - MSG, no timestamp yet) or RFC 3164 (<PRI>HOST TAG: MSG), PRI = facility*8 + severity; log.host as IP or resolved name; config applies live. Messages wait in the queue until the interface has an IP. POST /api/log/test sends an info message regardless of the level filter. - Initialised first in app_main so boot messages are captured; the UDP socket is created only once the interface is up (creating it before esp_netif_init crashed at boot and the bootloader rolled back). - Verified with a UDP listener: 5424 and 3164 formats, PRI 134/132, boot messages delivered after the IP came up, shutdown messages sent before reboot, level filter, test message, host by DNS name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,5 +4,6 @@
|
||||
|
||||
#include "esp_err.h"
|
||||
|
||||
// Registers the "log" config group. (Sender itself: step 5.)
|
||||
// Registers the "log" config group, hooks esp_log (still printed on the UART) and starts the
|
||||
// sender task. Messages logged before the interface has an IP are queued (up to the queue size).
|
||||
esp_err_t aes67_syslog_init(void);
|
||||
|
||||
Reference in New Issue
Block a user