NAME

catgen_initlog - set up log labels

SYNOPSIS

#include <cat/gen.h>

int catgen_initlog(const char *service);

DESCRIPTION

This function initializes the catgen log labels for a service. The label definitions are process-global.

All catgen functions that perform logging will use the labels defined by catgen_initlog

If the value ``log.facilityfile'' is supplied in the configuration data, either globally or for service, the log definitions will be read from this file. Otherwise, the standard built-in catgen log definitions will be used.

If no facility file is defined and standard labels are loaded, the facility label and code can be changed using the parameters ``log.facilitycode'' and ``log.facilitylabel''. Thus, it is possible to use a different facility with a superset of the standard messages by first calling catgen_loginit and then adding any new messages.

Message identifiers 10000-60000 are free for use by applications. All other message identifiers are reserved for future use by the SDK.

RETURN VALUES

If successful and the log definitions are read from a file, the function returns the number of log labels that were loaded successfully.

If successful and the standard log definitions are used, the function returns 0.

In both cases, the function returns a negative code on error.

SEE ALSO

cat, catgen

catgen_certerrtologid, catgen_initels, catgen_initlogfile, catgen_loadloglabels, catgen_log

elsfile