openlog()和syslog()的用法

来源:互联网 发布:lol美服加速器mac 编辑:程序博客网 时间:2024/06/05 13:14

http://blog.chinaunix.net/u/22878/showart_201445.html

 

openlog()和syslog()的用法
#include <syslog.h>
int main()
{
 int test = 10;
 
 openlog("MySysLogTest", LOG_PID|LOG_CONS, LOG_LOCAL7);
 
 syslog(LOG_LOCAL7|LOG_ERR, "ERROR: just my test error msg syslog(test val=%d)/n", test);
 closelog();
 return 0;
}