Open System Services Library Calls Reference Manual (G06.27+, H06.04+)

OSS Library Calls (s) syslog(3)
Table 63. Open System Services EMS Events
OSS EMS EMS
Event Level Event Number Event Name
______________________________________________________________
LOG_EMERG 5 ZOSS-EVT-SYSLOG-EMERG
LOG_ALERT 6 ZOSS-EVT-SYSLOG-ALERT
LOG_CRIT 7 ZOSS-EVT-SYSLOG-CRIT
LOG_ERR 8 ZOSS-EVT-SYSLOG-ERR
LOG_WARNING 9 ZOSS-EVT-SYSLOG-WARNING
LOG_NOTICE 10 ZOSS-EVT-SYSLOG-NOTICE
LOG_INFO 11 ZOSS-EVT-SYSLOG-INFO
LOG_DEBUG 12 ZOSS-EVT-SYSLOG-DEBUG
ZOSS-TKN-PID
Contains the OSS process ID of the calling process. This token is included in the
event only if the logopt parameter to the openlog() function has the value
LOG_PID.
syslog( ) automatically opens the connection to the collector if it is not already open. Therefore, it
is not necessary to call the openlog() function before calling syslog().Useopenlog() to over-
ride the default facility and event subject (identity string) values or to specify a number of log-
ging options for special processing. The closelog() function closes log les. The setlogmask()
function can override the logging default action, which is to log events of all priorities.
EXAMPLES
The syslog( ) event messages use the following text-formatting template:
facility level [, PID=pid] (ident) : text
In the following example, the call to syslog( ) describes an emergency: a re on the $SYSTEM
disk. The call to the openlog() function overrides the default event subject of "syslog" with
"Disk" and overrides the default facility of LOG_USER with LOG_KERN. It also includes the
logging option LOG_PID to display the OSS process ID of the calling process.
openlog ("Disk", LOG_PID, LOG_KERN | 1);
syslog (LOG_EMERG, "Fire on $SYSTEM")
These calls produce the following event message text:
KERNEL EMERGENCY, PID = 12345 (Disk): Fire on $SYSTEM
Note: The openlog() function changes the default facility only if the facility parameter is
not 0 (zero). Because the facility option LOG_KERN has the value 0 (zero), a bit
outside of the facility eld within the facility parameter must be set to 1 so that
openlog() changes the default facility to 0 (zero). To use the facility option
LOG_KERN as the default facility, logically OR that symbolic value with a 1.
RETURN VALUES
If the syslog() function successfully sends an event message (to ither $0 or the collector specied
by the EMS_COLLECTOR environment variable), or if the LOG_CONS option of the logopt
parameter of the openlog() function is not set, syslog() returns the value 0 (zero).
If the event message cannot be sent to either collector, syslog() returns a negative number and
errno is not set.
527187-004 Hewlett-Packard Company 6135