Previous Topic: Authentication SchemeNext Topic: Custom Extensions (SmAPSEx)


Custom Logging Extension (SmAPSLog)

APS calls a library called SmAPSLog at certain points during processing in order to record certain events. As supplied, SmAPSLog will record these events into a specified flat file. SmAPSLog is also supplied in source code so that sites can write their own logging functions.

The source code is supplied "as is", without additional support. If you choose to use the library as supplied (without recompilation), CA Professional Services will be glad to help you with any problems. If, however, you choose to build your own version, CA is not equipped to support your code.

The Policy Server installation kit installs SmAPSLog.cpp and SmAPSLog.h to your SiteMinder/Samples directory. These are the actual source files used to build the version of the SmAPSLog library that is installed by the kit.

Basically, if the SmAPSLog library exists, APS will load it and call its initialization function (called SMAPSLogInit). APS will pass a structure containing a large number of function pointers (defined in SmAPSLog.h), all initialized to NULL. If the SmAPSLog library is interested in any particular event, it must provide a valid function pointer for that event.

The SmAPSLog library must be fully re-entrant and thread-safe. It must not spend too much time processing a request, since this will have a direct impact on APS performance.

SmAPSLog cannot be installed while the SiteMinder services are running.

SmAPSLog must be written in C++. There are no plans to support any other languages and it is doubtful that it would even be possible at this time; it certainly would not be desirable, due to the high-performance and multi-tasking constraints of the functionality. If the logger must exist in another language, it would be best to write it as another server process and have a C++ language SmAPSLog library queue requests to it.

The SmAPSLog has some limited access to APS.cfg. All settings in the [Logging] section will be read and parsed by APS and passed to the SmAPSLog library as pointer to a class of APSDictionary that will allow the library to enumerate through the list of parameters and to retrieve specific values.

APS will automatically include the following settings in the dictionary, regardless of what is set in APS.cfg:

APS.SettingsIteration

APS rereads the APS.cfg file every time that it has changed. Each time that it is reread, the iteration number is incremented. This allows SmAPSLog to determine that the settings have changed since a prior call.

APS.Trace

The setting of the TRACE flag within APS.