linux log 日志编程

三个函数:

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查看

你可能感兴趣的:(编程,linux,user,table,insert)