RSA Security logo

RSA BSAFE Cert-C
API Reference

Status Log Service Provider

Status Log Elements: LOG_FUNCS
FILE_LOG_PARMS
Implementations: Cert-C Status Log Service Provider

Use the Cert-C Status Log service provider to append an application's error, warning, or information status message to its status log file. The LOG_FUNCS structure points to all the service provider functions. Any implementation of the Text Surrender service provider is based on this structure. Use the FILE_LOG_PARMS structure to pass initialization parameters to a Status Log service provider's initialization functions. Click on either structure name for information on any of the members in this structure.

Call the C_Log function to report a status message. The caller of the function provides the source code file and line number for the status message. The GetFormatStr function in LOG_FUNCS uses the status and statusType parameter values to select the appropriate status message format string. The Log function in LOG_FUNCS takes this formatted status message and appends it to the status log file.

There is only one implementation of this service provider included in Cert-C. Other implementations can be developed, if necessary.

Implementation 1: Cert-C Status Log Service Provider

Cert-C Status Log Service Provider Elements: S_InitializeFileLog

The Cert-C Status Log service provider is the Cert-C implementation of the status log service provider. If more than one status log service provider is registered, the application's status message is appended to all of the Status Log service provider's log files. It implements all the functions in LOG_FUNCS and uses the fields in FILE_LOG_PARAMS to pass initialization parameters.

To initialize or register the Cert-C Status Log service provider, call either C_InitializeCertC or C_RegisterService. Both functions take SERVICE_HANDLER and a POINTER to a SERVICE_HANDLER structure as a parameter. The Initialize member in SERVICE_HANDLER points to the S_InitializeFileLog function. Also, the corresponding parameter should either point to a FILE_LOG_PARAMS structure or it should be NULL_PTR. The S_InitializeFileLog function initializes the Cert-C Status Log service provider's implementation of the status log functions, and stores pointers to them in the log member in SERVICE_FUNCS, which is a LOG_FUNCS structure. Never call S_InitializeFileLog directly.

Any application using the Cert-C Status Log service provider should include the filelog.h header file. Most of the sample programs included in Cert-C make use of this service provider. They rely on the RSA_SetOptions function in demoutil.c to initialize a FILE_LOG_PARAMS structure and then use C_InitializeCertC to register the Cert-C Status Log service provider. This way problems that may occur while registering subsequent service providers can be logged.




RSA BSAFE® Cert-C 2.7 API Reference