stdsyslog(1)

stdsyslog1

Log a program's output to the system log

Usage

stdsyslog [-d fd:level] [-f facility] [-p pidfile] cmd [args ...]

stdsyslog -f list

stdsyslog -l

stdsyslog {-V | -h}

Overview

The stdsyslog utility executes a program, reads everything that it outputs to a set of file descriptors (by default the standard output and standard error streams) and logs it to the system log.

The stdsyslog utility may be passed the following options:

-d

Specify the level for messages on a file descriptor; may (and probably should) be used more than once. If no -d options are specified, stdsyslog will assume “-d 1:info -d 2:err”, i.e. log the program's standard output using the “info” level and the errors using the “err” one.

-f

Specify the syslog facility to use, or “list” for a list of the available values. If not specified, stdsyslog will use the “daemon” facility.

-h

Display program usage information and exit.

-l

List the available syslog levels.

-p

Specify the file to write the child process ID to.

-V

Display program version information and exit.

Examples

The following examples are shown as given to the shell.

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

Todo

Planned or at least possible enhancements:

*

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.

Releases

6 releases since Debian 8 (Jessie); the text changed 1 time.

  1. 8–12
  2. 13

From stdsyslog 0.03.4-1 in Debian 13 (Trixie). Parsed by carta from the page's mdoc source.