some-usable-scripts/c/old/libipc/example-syslog.c

23 lines
427 B
C
Raw Normal View History

2020-01-28 12:41:11 +01:00
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
int main(int argc, char * argv[])
{
argc = argc; // warnings
argv = argv; // warnings
setlogmask (LOG_UPTO (LOG_NOTICE));
openlog ("exampleprog", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
syslog (LOG_NOTICE, "Program started by User %d", 1000);
syslog (LOG_INFO, "A tree falls in a forest");
closelog ();
return EXIT_SUCCESS;
}