三个函数:
openlog()
syslog()
closelog()
Demo:
#include <syslog.h>
#include <stdio.h>
int main()
{
char *orderid = "order1";
openlog("Insert Table:",LOG_CONS,LOG_USER);
syslog(LOG_INFO,"insert success %s\n",orderid);
closelog();
return 0;
}
使用cat /var/log/messages查看