LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   tracing application logs in syslog (https://www.linuxquestions.org/questions/programming-9/tracing-application-logs-in-syslog-553633/)

shifter 05-13-2007 08:55 PM

tracing application logs in syslog
 
I 'd like that my daemon write your logs in /var/log/syslog file.
What is the correct way to use openlog, syslog and closelog ?
How can I to trace application logs in syslog ?

PS = I read yet man page!

stress_junkie 05-14-2007 04:01 AM

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.
Code:

man syslog
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.

bigearsbilly 05-15-2007 03:38 AM

yes,
there is a command-line utility logger which does the same sort
of thing, you can experiment with that maybe to speed up your
knowledge.


All times are GMT -5. The time now is 05:29 AM.