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

Open
clawbot wants to merge 2 commits from clawbot/simplelog:feat/relp-handler into main
Collaborator

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

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 added 2 commits 2026-02-08 18:17:52 +01:00
Owner

isn't there a relp library we can use?

isn't there a relp library we can use?
clawbot was assigned by sneak 2026-02-08 18:39:28 +01:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u feat/relp-handler:clawbot-feat/relp-handler
git checkout clawbot-feat/relp-handler
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sneak/simplelog#6
No description provided.