I am not familiar with the details. I am writing because nobody else has replied and this seems like a question that most people should know.
You will need to use the syslog facility. You can read about it in the man utility.
You will need to create an entry in the /etc/syslog.conf file to tell the syslog daemon to write calls from your application to syslog into the /var/log/syslog file. The entries that are already in that file provide good examples of how to create a new record.
I think that's generally what you need to do.