socklog(8)

πŸ“¦
version 2.1.2 Β· 2 versions
, in nixpkgs unstable, ubuntu resolute, ubuntu stonking

πŸ’– socklog(8) β€” the System Manager's Manual glow-up πŸ’–

okay bestie, gather round, because we're talking about socklog, and it's literally a small and secure syslogd replacement made to vibe with runit. she's tiny, she's careful, she's iconic. let's get into it πŸŽ€


✨ NAME ✨

socklog β€” a small and secure syslogd replacement, designed for use with runit. no cap, that's the whole thing. πŸ’…


🌸 SYNOPSIS 🌸

socklog [-rRU] [unix] [path]
socklog [-rR] inet [ip] [port]
socklog [-rR] ucspi [args]

three modes, three moods. pick your fighter. πŸ¦‹


πŸ’œ DESCRIPTION πŸ’œ

so here's the tea: socklog gets run under runit's runsv(8), and it writes the syslog messages it receives β€” either from a unix domain socket path or from an inet udp socket ip:port β€” through a pipe that runsv(8) hands it, straight to a svlogd(8) process. that's the pipeline, bestie, and it slays. πŸ”₯

socklog can also run as an ucspi application, which lets it listen on a unix domain stream socket and do more flexible distributed logging. fancy. ✨

if the environment variables $UID and/or $GID are present, socklog drops permissions to those ids after creating and binding the socket β€” and not in ucspi mode, just so we're clear. πŸ‘‘

socklog converts syslog facility and priority info into names, in the form facility.priority:, matching whatever's in /usr/include/syslog.h at compile time, if that file's even there. iykyk. 🌈

on solaris, socklog also accepts sun_stream as the first argument. peep the web page for the deets. 🌞


🧚 UNIX SOCKET 🧚

socklog [ unix ] [ path ]

start socklog with unix as the 1st argument and she'll listen to the unix domain socket path. if path is left out, the default is /dev/log. 🌸

and here's the cute part: you can totally skip the 1st argument, because the default is unix anyway. low maintenance queen. πŸ’…


⭐ INET SOCKET ⭐

socklog inet [ ip ] [ port ]

start socklog with inet as the 1st argument and she'll listen to the inet udp socket ip:port. πŸ“‘

  • if ip starts with 0, socklog binds to all local interfaces. all of them. every single one. 🫢
  • if port is less than or equal to 1024, socklog must be run by root. no exceptions, bestie, that's a privilege thing. πŸ”
  • port may be omitted β€” default is 514.
  • ip may be omitted β€” default is 0.

also, socklog prepends a.b.c.d: to every syslog message it receives, where a.b.c.d is the ip address of the connecting system. so you always know who's talking. πŸ‘€


πŸ¦‹ UCSPI MODE πŸ¦‹

socklog ucspi [ args ]

start socklog with ucspi as the 1st argument and she runs as an ucspi application. normally you'd only ever start socklog in ucspi mode through an ucspi server tool β€” think tcpsvd(8), tcpserver(1) or unixserver. she doesn't just show up like that on her own. πŸ’

for each arg, socklog will prepend $arg: to every syslog message, if the environment variable $arg is present. and yes, there's a limit β€” maximum is 8. don't get greedy. πŸ™ˆ


πŸ’… OPTIONS πŸ’…

  • -r β€” raw. write the raw syslog messages (no conversion of facility and priority) to the pipe, in addition to the log messages with syslog facility and priority converted to names. so you get both, because why choose. ✨
  • -R β€” raw only. same as -r above, but writes the raw syslog messages only. no name-converted versions, just the raw ones. periodt. πŸ’€
  • -U β€” respect umask. don't set umask to 0 before creating a unix domain socket; respect the current setting of umask(2) instead. heads up though β€” this option only takes effect in unix mode. πŸŽ€

🌈 SEE ALSO 🌈

sv(8), runsvdir(8), runsv(8), svlogd(8), tryto(1), uncat(1), socklog-check(8), tcpsvd(8), nc(1)

and the links, bestie:


πŸ‘‘ AUTHOR πŸ‘‘

Gerrit Pape <pape@smarden.org>


and that's the whole page, babes. this was the socklog(8) entry from the System Manager's Manual β€” the socklog(8) manual page, to be exact. go forth and log responsibly. πŸ’–πŸ«Άβœ¨

πŸ“¦ where this page comes from