You need the logger (1) utility available in the bsdutils package.
On the man page:
logger - a shell command interface to the syslog(3) system log module
There is nothing significant to configure, just pass the switches you need. For instance.
logger -p local3.info -t myprogram "What up, doc?"
Now you can check where local3.info messages go, and you will see something like this:
Jul 11 12:46:35 hostname myprogram: What up, doc?
You only need to worry about logrotate if you need something more enjoyable than that.
Regarding the use of the log, I would use the daemon for the daemon messages and local for most other things. You should consult syslog (3) for various objects.
source share