Logging involves the use of two Solaris Schema classes: Solaris_LogRecord and Solaris_LogService.
The Solaris_LogRecord class is defined in Solaris_Core1.0.mof to model an entry in a log file. When an application or provider calls the Solaris_LogRecord class in response to an event, the Solaris_LogRecord class causes all data generated by the event to be written to a log file. To see the definition of the Solaris_LogRecord class as part of the Solaris Provider, use a text editor to view the Solaris_Core1.0.mof file. The Solaris_Core1.0.mof file is located in /usr/sadm/mof/.
The Solaris_LogRecord class uses a vector of properties and key qualifiers to specify attributes of the events, system, user, and application or provider that generate data. Read-only qualifier values are generated transparently for use between the application and the CIM Repository. For example, the value RecordID uniquely identifies the log entry but is not displayed as part of the log format when you view generated data.
You can set the values of writable qualifier values. For example, you can set the qualifier values of properties such as ClientMachineName and ServerMachineName, which identify the system on which an event occurs.
When the SysLogFlag property is set to true, then
a detailed message of the log record is automatically sent to the
syslog daemon on Solaris systems.
The Solaris_LogService class controls the operation of the logging service and defines the ways in which log data is handled. This class has a set of methods that an application can use to distribute data about a particular event to the CIM Object Manager from the issuing application. The data becomes a trigger that generates a response from the CIM Object Manager, such as a retrieval of data from the CIM Repository.
clearLog - Saves and renames a current log file or deletes a saved log file
getNumRecords - Returns the number of records in a particular log file
listLogFiles - Returns a list of all log files stored in /usr/sadm/wbem/log
getCurrentLogFileName - Returns the name of the most recent log file
getNumLogFiles - Returns the number of log files stored in /usr/sadm/wbem/log
getLogFileSize - Returns the size, in megabytes, of a particular log file
getSyslogSwitch - Enables log
data to be sent to
syslog, the logging service
of the Solaris operating environment
getLogStorageName - Returns the name of the host computer or device where log files are stored
getLogFileDir - Returns the path and name of the directory where log files are stored
The Solaris_LogServiceProperties class lets you set logging properties. See "Setting Logging Properties".
You can view the definition of the Solaris_LogService class in the Solaris_Core1.0.mof file, which is located in /usr/sadm/mof/.