Open System Services Programmer's Guide

Table 28 OSS Logging Functions (continued)
DescriptionFunction
Sets the EMS event log masksetlogmask()
Logs messagessyslog()
These functions are described in closelog(3), openlog(3), setlogmask(3), and syslog(3)
reference pages, which are available either online or in the Open System Services Library Calls
Reference Manual.
Features Unique to OSS Logging
The OSS logging mechanism sends event messages to an EMS collector process rather than to a
syslogd process as used on some versions of the UNIX operating system. A collector process
gathers EMS events and their associated tokens and sends them to destinations determined by the
system manager. One of the EMS tokens contains message text.
Authorization, demon, kernel, and mail facilities are in the Guardian environment and do not
generate OSS events or messages.
Some priorities, facilities, and options used in logging on BSD versions of the UNIX operating
system have no effect in the OSS environment. For example, the LOG_NOWAIT option of the logopt
parameter of the openlog() function has no effect.
A child process uses the collector that the parent process passes to it in the EMS_COLLECTOR
environment variable.
For detailed information about event messages, the kinds of events to log, and how messages are
routed, refer to the EMS Manual.
Logging Interoperability
You can call OSS logging functions from a Guardian module that is part of an OSS process. You
cannot use the LOG_PID option of the openlog() function on a Guardian process.
OSS processes have the same access to EMS procedures as do Guardian processes. Both OSS
processes and Guardian processes can:
Call any of the EMS procedures for constructing events
Open collectors and send them events using the WRITEREAD or WRITEREADX procedures
Start a consumer distributor and receive EMS event messages
An OSS process must use Guardian file-system and process-control procedures to start and
communicate with the consumer distributor. For further information about using EMS, refer to the
EMS Manual.
How to Log Information With the OSS API
You log information by using the OSS syslog() function. If you want to use the default settings,
simply call the syslog() function.
You can customize logging by performing one or both of the following actions before you call
syslog():
Call the setlogmask() function to specify the kinds of events to be logged.
Call the openlog() function to initialize logging parameters.
You can explicitly close the EMS collector process you are using with the closelog() function.
The OSS logging functions use the parameters and default parameter values shown in Table 29.
The parameters and default values are described in detail later in this section.
Logging Interoperability 237