STDSYSLOG(1)

πŸ“¦
version 0.03.4 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– STDSYSLOG πŸ’–

okay so bestie, welcome to stdsyslog(1) β€” it lives in the General Commands Manual section of your friendly neighborhood Unix, and it is literally the moment your program's output stops being a mystery and starts being a permanent record. no cap. 🫢


✨ NAME ✨

stdsyslog β€” log a program's output to the system log


🌸 SYNOPSIS 🌸

stdsyslog [-d fd:level] [-f facility] [-p pidfile] cmd [args...]
stdsyslog -f list
stdsyslog -l
stdsyslog -V | -h

πŸ’… DESCRIPTION πŸ’…

So the tea is this: the stdsyslog utility runs a program for you, slurps up everything it spits out onto a set of file descriptors (by default that's the standard output and the standard error streams), and then logs all of it to the system log. main character energy for your logs, honestly. πŸ‘‘

The stdsyslog utility may be passed the following options:

  • -d β€” tell it the level to use for messages coming off a file descriptor. you can β€” and honestly you probably should β€” use this more than once. and if you pass no -d options at all, stdsyslog just assumes -d 1:info -d 2:err, like, it logs the program's standard output with the info level and the errors with the err one. default queen behavior. ✨
  • -f β€” pick the syslog facility to use, or pass list to get a list of the available values. if you don't specify anything, stdsyslog uses the daemon facility.
  • -h β€” shows you the program usage info and dips out. exit, stage left. πŸšͺ
  • -l β€” lists all the available syslog levels.
  • -p β€” name the file you want the child process ID written into.
  • -V β€” shows program version info and dips out. πŸšͺ

πŸ¦‹ EXAMPLES πŸ¦‹

the following examples are shown as given to the shell, so you can copy-paste them straight into your terminal and feel iconic. πŸ’…

Log the string information to the daemon:info syslog facility:

stdsyslog echo information

Log the string error to the local4:err facility:

stdsyslog -f local4 sh -c 'echo error 1>&2'

Run the sprog program with two arguments, some and args, store its process ID into the sprog.pid file and log the messages appearing on its standard output to daemon:info and the ones on its standard error stream to daemon:crit:

stdsyslog -p sprog.pid -d 1:info -d 2:crit sprog some args

πŸ‘€ SEE ALSO πŸ‘€

logger(1), syslog(3)


🌈 TODO 🌈

planned or at least possible enhancements β€” the glow-up list, fr fr:

  • Command-line flags to specify openlog(3) options.
  • Command-line flags to specify patterns for text appearing on some file descriptors for possibly logging with another priority, e.g. lines appearing on the standard error stream starting with DBG: should be logged with the debug priority.

and that's the whole page, bestie πŸŽ€ this one came out of Debian and it's dated February 8, 2013 β€” oldie but a goodie, and now you know it through and through. go log something. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from