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.