|LOGGER(1)||General Commands Manual||LOGGER(1)|
loggercan be used to log messages to the system log daemon from a UNIX shell, or script. Optionally a stand-alone log file can be used, in which case the syslogp(3) API is still used but
syslogdis bypassed. This log file can also be automatically log rotated. Without a MESSAGE argument
loggerreads input from stdin.
syslog() fails to send message to syslogd(8).
-mfor caveats. Also, please note that sd has to be passed as one argument and will require careful quoting when used from the shell.
-f-as an alias for stdout.
-fFILE are not used. When
syslogdeventually starts, it will recognize these messages, due to not having kernel facility, and log them properly. Highly useful for userspace scripts and applications running before
syslogdhas started. E.g., mount helpers and similar.
loggerfrom a shell prompt due to expansion the shell does. If no message is given
loggerwill read from stdin until EOF. In this mode every new row (newline separated) is converted into an independent syslogp(3) call.
logger -t dropbear -p auth.notice "Successful login for user 'admin' from 188.8.131.52" logger -t udhcpc -f /tmp/script.log "New lease 184.108.40.206 obtained for interface eth0"
-fFILE, then this file is opened and written to by
logger. When log file rotation is enabled, using
loggercreates FILE.1 FILE.2 FILE.3.gz etc.
loggerwas originally written by Joachim Wiberg to be a part of the finit(1) system monitor (PID 1), where it is called
logit. It is included here to complement syslogd(8) and be extended upon in the sysklogd project.
loggercommand is expected to be IEEE Std 1003.2 ("POSIX.2") compatible, with extensions for RFC5424 from NetBSD and custom log file and log file rotation unique to the sysklogd project.
|February 21, 2021||sysklogd|