feat: add RELP handler for reliable log delivery to rsyslog (closes #5) #8

zavřený
clawbot chce sloučit 3 commity z větve feat/relp-handler do main
Spolupracovník

Replaces PR #6 (which pulled from the clawbot fork). Branch is now repo-local.

Implements the planned RELP feature from the README.

What

  • New RELPHandler that delivers log messages to a remote rsyslog server via RELP (TCP)
  • Configured via LOGGER_RELP_URL env var (e.g. tcp://rsyslog.example.com:2514)
  • Pure Go implementation — no CGO, no librelp dependency

How it works

  • Lazy connection on first log message
  • RELP session: open handshake → syslog commands → graceful close
  • Per-message acknowledgement (waits for rsp 200 from server)
  • Auto-reconnect on connection failure
  • Messages formatted as RFC 5424 syslog with structured data from slog attributes
  • Transaction number tracking with proper wraparound at 999,999,999

Notes

  • Also includes the deadlock fix from #3 (cherry-picked) since it was needed as a clean base
  • No TLS support yet (could be added later via tls:// scheme)
  • Default port 2514 (standard RELP/imrelp port)

Closes #5

Replaces [PR #6](https://git.eeqj.de/sneak/simplelog/pulls/6) (which pulled from the clawbot fork). Branch is now repo-local. Implements the planned RELP feature from the README. ## What - New `RELPHandler` that delivers log messages to a remote rsyslog server via RELP (TCP) - Configured via `LOGGER_RELP_URL` env var (e.g. `tcp://rsyslog.example.com:2514`) - Pure Go implementation — no CGO, no librelp dependency ## How it works - Lazy connection on first log message - RELP session: `open` handshake → `syslog` commands → graceful `close` - Per-message acknowledgement (waits for `rsp 200` from server) - Auto-reconnect on connection failure - Messages formatted as RFC 5424 syslog with structured data from slog attributes - Transaction number tracking with proper wraparound at 999,999,999 ## Notes - Also includes the deadlock fix from #3 (cherry-picked) since it was needed as a clean base - No TLS support yet (could be added later via `tls://` scheme) - Default port 2514 (standard RELP/imrelp port) Closes #5
clawbot přidal/a 3 commity 2026-03-01 15:00:10 +01:00
Vlastník

tbh i think this is out of scope for simplelog. if we do do it, it should be with TLS support and the whole relp client should be pulled out into its own package. closing for now.

tbh i think this is out of scope for `simplelog`. if we do do it, it should be with TLS support and the whole relp client should be pulled out into its own package. closing for now.
sneak uzavřel/a tento pull request 2026-03-01 15:09:59 +01:00

Pull request uzavřen

Přihlaste se pro zapojení do konverzace.
Žádní posuzovatelé
2 účastníků
Oznámení
Termín dokončení
Žádný termín dokončení.
Závislosti

Nejsou nastaveny žádné závislosti.

Reference: sneak/simplelog#8