Writing Monitors for the Event Monitoring Service (December 1999)

Chapter 2 45
The EMS Application Programming Interface (API)
Function Descriptions
rm_log
Used by resource monitors to print user-defined messages to an EMS log
file. Resource monitors log messages to /etc/opt/resmon/log/api.log.
Function Prototype
void rm_log (sbit32 log_level, char *fmt, /* [arg,] */ ... );
Parameters
[arg, ...]
Arguments, similar to printf(3S).
fmt
A format, similar to printf(3S).
log_level
Identifies the severity level of the message. See Table 2-8:
Returned Value
None.
Usage Notes
By default, only messages at levels RM_AUDIT_LVL, RM_PANIC_LVL, and
RM_ERROR_LVL are logged. Messages at RM_WARN_LVL are not logged by
default. Therefore, if you want to ensure that a message is logged, set the
log level to RM_AUDIT_LVL, RM_PANIC_LVL, or RM_ERROR_LVL. See the
section, “Logging and Tracing” for more details.
Table 2-8
log_level
Parameter Values
Value Description
RM_AUDIT_LVL The message will always be logged, regardless of the
value of the RM_LOG_LEVEL environment variable.
RM_ERROR_LVL The program has encountered an unexpected error. Future
operation may not be reliable.
RM_NOTE_LVL The message is intended for informational purposes only.
RM_PANIC_LVL The program has encountered a critical internal error.
Correct operation in the future is unlikely.
RM_WARN_LVL The program has encountered a recoverable error
condition. Unless accompanied by a more serious error
message, operation should continue successfully.