Open System Services Programmer's Guide
8 Using Logging Mechanisms
This section describes how to log information in the OSS environment.
You can log information in two ways in the OSS environment:
• With the OSS logging functions
• With Event Management Service (EMS) procedures
Use the OSS logging functions in portable applications. These functions enable you to use the
function calls of the Berkeley Software Distribution (BSD) UNIX logging mechanism to send log
messages. However, rather than sending log messages to a logging demon, the OSS logging
mechanism sends log messages to EMS.
EMS is a collection of Guardian processes, tools, and interfaces that collects and distributes
messages. EMS relays OSS log messages to destinations such as the system operator’s message
terminal (which is somewhat like a UNIX console). The destinations of the log messages are
determined by the manager of the system that your application is running on and are set up using
EMS.
Use EMS procedures in OSS programs that are written specifically for the OSS environment. EMS
procedures enable you to provide more concise and meaningful events than would be produced
using the OSS logging functions. You use EMS by calling Guardian procedures. EMS procedures
are not discussed in this guide. For information about using EMS, refer to the EMS Manual.
OSS processes can receive EMS messages by starting a consumer distributor process in the same
way a Guardian process can. An OSS process must use Guardian file-system and process-control
procedures to start and communicate with the consumer distributor.
This section discusses the following topics:
ContentTopic
Summary of the differences between OSS and UNIX
logging mechanisms.
“Common and Unique Characteristics” (page 236)
The processes in which you can use OSS logging functions.“Logging Interoperability” (page 237)
How to use the OSS logging functions.“How to Log Information With the OSS API” (page 237)
List of each OSS logging mechanism function with notes
about its OSS implementation and use on Guardian
processes.
“OSS Logging-Mechanism Functions” (page 243)
Common and Unique Characteristics
The behavior of the OSS logging functions are the same as those of the BSD UNIX logging functions,
but the ways in which the BSD and OSS functions perform their tasks are different.
Features Common to UNIX and OSS Logging
The OSS logging functions are the same as the BSD logging functions, but they might be somewhat
different from message-logging functions in other varieties of the UNIX operating system.
The OSS API provides the logging functions shown in Table 28.
Table 28 OSS Logging Functions
DescriptionFunction
Closes the connection to the collectorcloselog()
Initializes logging parametersopenlog()
236 Using Logging Mechanisms