TrumanWong

logger

Record corresponding entries in the system log

Supplementary instructions

logger command is used to write logs to the system. It provides a shell command interface to the syslog system module.

grammar

logger [options] [message]

Options

  -T, --tcp Use streaming connection (TCP)
  -d, --udp use datagram (UDP)
  -i, --id record the process ID of each logger line by line
  -f, --file <file> Log specific files
  -h, --help display help text and exit
  -n, --server <name> Write to the specified remote syslog server, using UDP instead of the built-in syslog routine
  -P, --port <port> Use the specified UDP port. The default port number is 514
  -p, --priority <prio> Specifies the priority of the input message. The priority can be a number or specified in the format of "facility.level".
                        For example: " -p local3.info " local3 The message level of this device is info.
                        The default level is "user.notice"
  -s, --stderr Output standard error to the system log.
  -t, --tag <tag> specifies tag records
  -u, --socket <socket> Write to the specified socket instead of to the built-in syslog routine.
  -V, --version output version information and exit

example

logger -p syslog.info "backup.sh is starting"