How to Log a message from a function to the system log?

i know where the system log is , but i have issue with logging a message.

please help me out by showing small examples for both application and syatem log