logger [ -is ] [-f file] [-p pri] [-t tag] [-u socket] [message ...]
Provides a command interface to send messages to the syslog daemon who will decide where they should be forwarded to.
example†:
myUpdater.sh
notice that it ran containing the last line of the stdout
info
stderr to syslog with priority of error
myUpdater.sh 1> /tmp/myUpdater.log 2> /tmp/myupdater.err rc=$? tail -n1 /tmp/myUpdater.log | logger -p local3.notice logger -p local3.info -f /tmp/myUpdater.log if [ $rc != 0 ]; then logger -p local3.err -f /tmp/myUpdater.err -s fi
-i | process id of the logger process | ||||||||||
-s | Log the message to standard error, as well as the system log. | ||||||||||
-f file | Enter the contents of file into the log. | ||||||||||
-p pri | Enter the message with the specified priority. | ||||||||||
-p facility.level The priority may be specified numerically or as a | facility.level pair. -p local3.info level in the local3 facility. The default is user.notice.
| -t tag tag line .
| | -u socket Write to socket instead of builtin syslog routines. (port 514)
| | -d Use a datagram instead of a stream connection to this socket.
| | -- End of options, (allows message to start
with a hyphen ( | -)).
| if no message is specified standard input is logged
| |
| facilities: |
cron, ftp, lpr, kern, mail, news, syslog, uucp,auth, authpriv (for security information of a sensitive nature),security(deprecated synonym for auth),daemon, user, local0, 1 … 6, local7
|
| levels: | emerg,
panic, alert, crit,
err, error,
warning, warn, notice, info, debug
|
logger -p local0.notice -t HOSTIDM -f rootStatNotes logger System rebooted
For the priority order and intended purposes of these levels,
See
syslog(BSDactually Mac OSX ; darwin), syslogd(8)
June 6, 1993 4.3 Berkeley Distribution
Made true HTML and terse by Dennis German