Writing Monitors for the Event Monitoring Service (December 1999)
32 Chapter2
The EMS Application Programming Interface (API)
Logging and Tracing
Logging and Tracing
For the specifications for the user-callable logging function, see
rm_print, rm_perror, rm_log, and rm_strerror.
By default, only User Events, Panics, and Errors are logged. User Events
are defined when the monitor implements rm_log () API or other
logging API.To see log messages with alower severity, and to see internal
trace information for debugging purposes, use the RM_LOG_LEVEL
environment variable. The environment variable is read by the client
application and is passed through the Registrar to any resource monitors
that are queried on behalf of the client application. This way, the client
application, the Registrar, and the resource monitor will all have the
same logging level.
Table 2-4 shows the environment variable values that are understood by
EMS.
For verbose tracing, set RM_LOG_LEVEL=DEBUG in the client application
environment. Alternatively, create a file called /etc/opt/resmon/debug
which forces client applications to use verbose logging. When verbose
Table 2-4 RM_LOG_LEVEL Defined Values
RM_LOG_LEVEL
Value
Messages Logged
DEBUG User Events and messages with a severity level of
RM_AUDIT_LVL, RM_PANIC_LVL, RM_ERROR_LVL,
RM_WARN_LVL, and RM_NOTE_LVL, plus internal
product tracing.
ERRORS (default) User Events and messages with a severity level of
RM_AUDIT_LVL, RM_PANIC_LVL or
RM_ERROR_LVL. This is the default logging level.
NOTES User Events and messages with a severity level of
RM_AUDIT_LVL, RM_PANIC_LVL, RM_ERROR_LVL,
RM_WARN_LVL, and RM_NOTE_LVL.
WARNINGS User Events and messages with a severity level of
RM_AUDIT_LVL, RM_PANIC_LVL, RM_ERROR_LVL,
and RM_WARN_LVL.