openlog()

set process attributes for syslog() 

Function


SYNOPSIS

#include <syslog.h>

openlog(const char *ident, int logopt, int facility);


DESCRIPTION

The openlog() function sets process attributes that affect subsequent calls to syslog().


PARAMETERS

ident 

Is a string that is prepended to every message.

logopt 

Specifies the logging options. Values for logopt are constructed by a bitwise-inclusive OR of zero or more of the following:

LOG_PID 

Log the pid with each message.

LOG_CONS 

Log on the console if errors in sending.

LOG_NDELAY 

Delay open until first syslog(). (default)

LOG_ODELAY 

Do not delay open.

LOG_NOWAIT 

Do not wait for console forks.

LOG_PERROR 

Log to stderr as well.

facility 

Indicates the application or system component generating the message. Possible facility values include:

LOG_KERN 

Kernel messages.

LOG_USER 

User-level messages.

LOG_MAIL 

Mail system.

LOG_DAEMON 

System daemons.

LOG_AUTH 

Security/authorization messages.

LOG_SYSLOG 

Messages generated internally by syslogd.

LOG_LPR 

Line printer subsystem.

LOG_NEWS 

Network news subsystem.

LOG_UUCP 

UUCP subsystem.

LOG_CRON 

Clock daemon.

LOG_AUTHPRIV 

Security/authorization messages (private).

LOG_LOCAL0 

Reserved for local use.

LOG_LOCAL1 

Reserved for local use.

LOG_LOCAL2 

Reserved for local use.

LOG_LOCAL3 

Reserved for local use.

LOG_LOCAL4 

Reserved for local use.

LOG_LOCAL5 

Reserved for local use.

LOG_LOCAL6 

Reserved for local use.

LOG_LOCAL7 

Reserved for local use.


RETURN VALUES

None.


CONFORMANCE

UNIX 98.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

On 8.1/2012R2/10/2016/2019/11/2022, messages are logged in the system's Application Event log. The ident string passed to openlog() is used as the Event Source name. You can use the Windows Event Viewer to display the Application Event log.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
closelog(), setlogmask(), syslog(), vsyslog()


PTC MKS Toolkit 10.4 Documentation Build 39.