Write an informational message to the server error log.
#include "slapi-plugin.h" int slapi_log_info_ex(slapi_log_info_area_t area, slapi_log_info_level_t level, long msgId, int connId, int opId, char const * subsystem, char const * fmt, /* args */, ...);
This function takes the following parameters:
Identifies the server component so logging can be turned on by adding the decimal value of the area to the value for nsslapd-infolog-area. Subtract from the value to turn informational logging off.
Identifies whether the server should log this message when informational logging is activated for area.
When informational logging is activated, setting level to:
SLAPI_LOG_INFO_LEVEL_DEFAULT means always log the message.
SLAPI_LOG_INFO_LEVEL_EXTRA means only log if the value of nsslapd-infolog-level is greater than 0.
Identifier for the current message obtained using SLAPI_OPERATION_MSGID
Identifier for the current connection obtained using SLAPI_CONN_ID
Identifier for the current operation obtained using SLAPI_OPERATION_ID
String indicating the context in which the warning arose such as the name of the plug-in function logging the message
Format specification in the style of printf()
Arguments for the format specification in fmt
This function writes the specified error message to the server error log in synchronous fashion. This function does not return until the log message has been flushed to disk, thus blocking the server for the duration of the write operation. By default, the error log is $INSTANCE_PATH/logs/errors.
This function is turned off by default. Activate logging of the message with the dsconf set-log-prop command.
You can also manage logs using Directory Service Control Center.
Informational message are typically those that system administrators may ignore unless trying to debug server behavior. For errors, use slapi_log_error_ex() . For warnings, use slapi_log_warning_ex().
Example 16–3 shows a call to slapi_log_info_ex().
#include "slapi-plugin.h" int hello() { slapi_log_info_ex( SLAPI_LOG_INFO_AREA_PLUGIN, SLAPI_LOG_INFO_LEVEL_DEFAULT, SLAPI_LOG_NO_MSGID, SLAPI_LOG_NO_CONNID, SLAPI_LOG_NO_OPID, "hello() from a plug-in", "Hello, World!\n" ); return 0; }
This function returns 0 if successful. Otherwise, it returns -1.