Open System Services Programmer's Guide
Table 30 Logging Level Event Numbers and Strings
Message StringEMS Event NumberLevel
EMERGENCY (most severe)5LOG_EMERG
ALERT6LOG_ALERT
CRITICAL7LOG_CRIT
ERROR8LOG_ERR
WARNING9LOG_WARNING
NOTICE10LOG_NOTICE
INFO11LOG_INFO
DEBUG (least severe)12LOG_DEBUG
Initializing Logging Parameters
The openlog() function initializes the Event Management Service (EMS) event log parameters
that are used by the OSS logging mechanism. It enables you to change the values of the parameters
listed in Table 31 if you do not want to use the default values.
Table 31 openlog() Parameters Used by OSS Logging Mechanism
DescriptionParameter
The part of the system you specify as having generated the event messagefacility
An event subject string that appears in the messageident
Logging optionslogopt
facility Parameter
The facility parameter enables you to specify the part of the system that generates the event
message. The default facility is LOG_USER; this is the only facility that has meaning in the OSS
environment. Although authorization, demon, kernel, and mail facilities are in the Guardian
environment and do not generate OSS events or messages, you can use the openlog() function
to specify any facility.
The openlog() function changes the default facility only if the facility parameter is nonzero.
The value of LOG_KERN is 0, so to change the facility to LOG_KERN, change its value to 1 using
the exclusive-or operator, as shown in the following example:
openlog(LOG_KERN | 1);
The facility parameter is also displayed as a string in the OSS log message. The facilities and
their strings are listed in Table 32.
Table 32 OSS Logging Facilities
DescriptionMessage StringFacility
Messages generated by the login, su, and other shell
commands or utilities belonging to a user authorization
system.
AUTHLOG_AUTH
Messages generated by a clock demon.CRONLOG_CRON
Messages generated by system demons.DAEMONLOG_DAEMON
Messages generated by the kernel.KERNELLOG_KERN
Messages generated by local facilities. This option is
reserved for local site use.
LOCAL[0-7]LOG_LOCAL[0-7]
How to Log Information With the OSS API 239