Activating Logging

Logging is activated by setting up redirection of ProtectToolkit-C host library calls sent from the application so that they are instead delivered to the logger. This procedure differs between Windows and UNIX systems. To activate logging, consult the section below applicable to your operating system.

Windows Systems

To activate logging on a Windows-based system, ProtectToolkit-C host library calls are redirected to the logger by replacing the path to the ProtectToolkit-C host library (Cryptoki provider) with the path to the logger. This change can be made in either the Windows registry or the environment variables. The ProtectToolkit-C host library and the logger are both named cryptoki.dll so the application does not detect any difference and is unaffected by this change.

To enable the logger in the system environment variables

1.Edit the Environment Variables in the Windows Control Panel.

2.Create new system environment variables for ET_PTKC_LOGGER_FILE and ET_PTKC_LOGGER_PKCS11LIB. For more information about configuring these environment variables, refer to Logger Configuration Items.

To enable the logger in the Windows registry

1.Open the Windows Registry Editor (regedit.exe).

2.Create a new key: HKEY_LOCAL_MACHINE\SOFTWARE\Safenet\PTKC\LOGGER

3.Under this key, create two string values for ET_PTKC_LOGGER_FILE and ET_PTKC_LOGGER_PKCS11LIB. For more information about the valid string values for these environment variables, refer to Logger Configuration Items.

UNIX Systems

To activate logging on a UNIX based system, ProtectToolkit-C host library calls are redirected to the logger by:

1.Reassigning the libcryptoki.so (libcryptoki.sl for HP-UX on PA-RISC, libcryptoki.a for AIX) symbolic link from the ProtectToolkit-C host library (Cryptoki provider) that was set up during installation to the logger shared library liblogger.so (liblogger.sl for HP-UX on PA-RISC, liblogger.a for AIX).

2.Including the logger library in the LD_LIBRARY_PATH (SHLIB_PATH for HP-UX on PA-RISC, LIBPATH on AIX) environment variable.

The application does not detect any difference and is unaffected by this change.

For example, use the following commands to reassign the libcryptoki.so symbolic link:

# cd /opt/safenet/protecttoolkit5/ptk/lib # ln -sf liblogger.so libcryptoki.so

Changing Detail Recorded by the Logger

To change the level of detail recorded by the logger, override the default values of the following configuration items:

>ET_PTKC_LOGGER_LOGPID

>ET_PTKC_LOGGER_LOGTID

>ET_PTKC_LOGGER_LOGTIME

>ET_PTKC_LOGGER_LOGMEM

>ET_PTKC_LOGGER_LOGPIN

For more information about these configuration items, refer to Logger Configuration Items.

The changes can be made at the temporary, user or system levels on both UNIX and Windows platforms. Refer to Configuration Items for more information.