HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
30 Functions for logging
This chapter contains reference information on logging routines.
Table 30-1 Logging routines
DescriptionFunction
Writes a message to the error log for the Directory Server.“slapi_log_error()”
Checks if loglevel is selected as a log level.
“slapi_is_loglevel_set()”
30.1 slapi_log_error()
Writes a message to the error log for the Directory Server. By default, the error log file is
/var/opt/dirsrv/slapd-instance_name/log/errors.
Syntax
#include "slapi-plugin.h"
int slapi_log_error( int severity, char *subsystem, char *fmt, ... );
Parameters This function takes the following parameters:
Level of severity of the message. In combination with the severity level specified by
the administrator, this determines whether the message is written to the log.
severity
Name of the subsystem in which this function is called. The string that you specify
here appears in the error log in the following format: subsystem_name:message
subsystem
Message that you want written. This message can be in printf()-style format.
For example:..., %s\n,myString);
fmt, ...
The severity argument corresponds to the Log Level setting selected by in the Server Manager
under Server Preferences | LDAP. If a Log Level setting is selected, messages with that severity
level are written to the error log. The severity argument can have one of the following values:
Always written to the error log. This severity level indicates that a fatal error
has occurred in the server.
SLAPI_LOG_FATAL
Written to the error log if the Log Level setting "Trace function calls" is
selected. This severity level is typically used to indicate what function is being
called.
SLAPI_LOG_TRACE
Written to the error log if the Log Level setting "Packet handling" is selected.
SLAPI_LOG_PACKETS
Written to the error log if the Log Level setting "Heavy trace output" is
selected.
SLAPI_LOG_ARGS
Written to the error log if the Log Level setting "Connection management" is
selected.
SLAPI_LOG_CONNS
Written to the error log if the Log Level setting "Packets sent/received" is
selected.
SLAPI_LOG_BER
Written to the error log if the Log Level setting "Search filter processing" is
selected.
SLAPI_LOG_FILTER
Written to the error log if the Log Level setting "Config file processing" is
selected.
SLAPI_LOG_CONFIG
Written to the error log if the Log Level setting "Access control list processing"
is selected.
SLAPI_LOG_ACL
30.1 slapi_log_error() 253