#include <syslog.h>
1 openlog("oec", LOG_PID, LOG_LOCAL0);
2 syslog(LOG_INFO, "Hello from oec");
3 closelog();
1 Open a log facility with the name of local0. Prefix each line in the log file with the program name (oec) and the process ID.
2 Log an info priority message with the specified content.
3 Close the log facility name.
May 26 11:27:51 mvs18oe oec[3014660]: Hello from oec
For more information about the syslog function, see Advanced Programming in the UNIX Environment, published by Addison-Wesley or z/OS XL C/C++ Runtime Library Reference.