Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please help me!!
i want to log some data of my program using syslog().
but i don't know the procedure,
i googled and i understood i should modify rsyslog.conf but i dont have permission to modify it!!
please help!!
Posted

1 solution

You should be able to use the syslog(3)[^] calls without the need to change any system configuration.
 
Share this answer
 
Comments
[no name] 26-Jul-12 5:19am    
but my question is how can i use my own logfile?
and a new question is where the log is stored?
Richard MacCutchan 26-Jul-12 5:33am    
Read the man pages, all the information you need is in there.
Jochen Arndt 26-Jul-12 6:27am    
If you don't want to use syslog, just open a file in append mode and write your log data to it.

It's your decision where to store it. /var/log or a subdirectory are common places but your program requires write access to the directory.

For non-system programs you can create your program specific directory and write the log to that directory (or better a sub directory); e.g. /usr/local/myprogram/var/log. Or just use a subdirectory of your home dir if the program is only executed by you.
Richard MacCutchan 26-Jul-12 6:33am    
OP did specifically ask about using syslog().
Jochen Arndt 26-Jul-12 6:42am    
Ups. I missed that. Thank you for pointing to it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900