syslog()

log an event message 

Function


SYNOPSIS

#include <syslog.h>

syslog(int priority, char *message, ...);


DESCRIPTION

The syslog() function is used to log an event message. The event message is written to the end of the configured logfile.

In the event log file, the date, time, user name, computer name, event ID, source, event type, and event category are penned to the log message.


PARAMETERS

priority 

Is encoded within the NuTCRACKER Platform to reflect the Microsoft Win32 event type. The UNIX priority is translated as follows:

LOG_EMERG 

An error event. This priority logs the event as a Win32 error event and displays the alert box containing the message on the screen. The process is terminated when the user selects OK in the dialog box.

LOG_ALERT, LOG_CRIT, LOG_ERR 

An error event. This priority logs the event as a Win32 error event and returns control to the calling process.

LOG_WARNING 

A warning event. This priority logs the event as a Win32 warning event and returns control to the calling process.

LOG_NOTICE, LOG_INFO, LOG_DEBUG 

An information event. This priority logs the event as a Win32 information event and returns control to the calling process.

message 

Is used with the following arguments to generate the message body in the same manner as if these were arguments to printf(), except that occurrences of %m in the format string pointed to by the message argument are replaced by the error messages string associated with the current value of errno. A trailing newline character is added if needed.

... 

Represents printf()-style substitution arguments for message.


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. The priority passed to syslog() is used as the event priority. 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(), openlog(), setlogmask(), vsyslog()


PTC MKS Toolkit 10.4 Documentation Build 39.