Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
syslog(3) OSS Library Calls Reference Manual
Table 6−3. 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 files. 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 fire 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 field 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
The syslog( ) returns the value 0 (zero) if any of these conditions occur:
• The syslog( ) function successfully sends an event message to either $0 or the collector
specified by the EMS_COLLECTOR environment variable (if the application is started
from the OSS environment) or the Guardian EMSˆCOLLECTOR PARAM (if the appli-
cation is started from the Guardian environment).
• The LOG_CONS option of the logopt parameter of the openlog( ) function is not set.
6−220 Hewlett-Packard Company 527187-017