gtpc2m59C/C++ Language Support User's Guide

openlog-Open the System Control Log

This function opens a connection to the logging facility and sets process attributes that affect subsequent calls to the syslog function. Use this function with the syslog function and the closelog function to use the logging facilities provided with the syslog daemon.

See TPF Transmission Control Protocol/Internet Protocol for more information about the syslog daemon.

Format

#include <syslog.h>
void     openlog(const char *ident, int logopt, int facility);

ident
A pointer to a string that is prefixed to every message or a NULL pointer.

logopt
Specify the following value or NULL:

LOG_PID
Log the process ID with each message. This is useful for identifying specific processes.

facility
Specifies a default facility to be assigned to all messages that do not have an explicit facility already coded. If you specify NULL, the initial default facility is LOG_USER. See syslog-Send a Message to the Control Log for more information about the other values that can be specified.

Normal Return

Void.

Error Return

Not applicable.

Programming Considerations

Examples

See syslog-Send a Message to the Control Log for an example using the openlog function.

Related Information