Ubuntu – Write to syslog from the command line

command linesyslog

How can I write an entry into /var/log/syslog from the command line?

Best Answer

Use the logger command.

logger Some message to write

There are several options available, including:

-i Log the process ID in each line
-f Log the contents of a specified file
-n Write to the specified remote syslog server
-p Specify a priority
-t Tag the line with a specified tag

See man 1 logger for more information on the tool.

Related Question