I have a C program I am writing and need this program to write to syslog and have the logs in a separate file for my program.
Eg. My program is called "example.c", then I want to have a log file called "example.log" in /var/log. Do I define log file "example.log"in syslogd.conf file?
Or have the C-Program to write to this file via syslog?
I want to have the message in the format yyyy/mm/dd 24HR:MM:SS LOG_TYPE: MESSAGE
I need to have date and time in format yyyy/mm/dd 24HR:MM:SS. Log_type is an severity of error. and MESSAGE is acutal error message.
Any suggestions in doing this in C?