Enhanced Logging for IPsec/IKE

Jump to: navigation, search

Table of Contents >> IPsec/IKE Programmer's Reference

Enhanced logging provides Module-based and Level-based logging with a user API that provides selectivity for both Level and Verbosity. The logging function can be easily customized. An API provides a means for setting the active Level for each Module on the fly. As the Logging Level is changed, the information for the new Level is included along with information for all "lower" levels. In this respect, the Levels are presented in order of low to high. For example, setting the Logging Level of a Module to Warning results in generation of all Warning and Error messages.

To enable Enhanced Logging, define TM_USE_LOGGING_LEVELS in <trsystem.h>.

The following sections describe each Module, Level, and the API.

Enhanced Logging Modules

Logging Modules can be selectively defined in <trsystem.h> as follows:

 
#define TM_LOG_ENB_ALL_MODULES          /* Enables logging for all Modules */
#define TM_LOG_ENB_MODULE_GEN           /* Enables General logging */
#define TM_LOG_ENB_MODULE_TEMP          /* Temporary (for dev only) */
#define TM_LOG_ENB_MODULE_IKE           /* Enables IKE processing logs */
#define TM_LOG_ENB_MODULE_IPSEC         /* Enables IPsec processing logs */
#define TM_LOG_ENB_MODULE_SECURITY      /* Enables general Security logs */
#define TM_LOG_ENB_MODULE_CRYPTO        /* Enables Crypto logs */
#define TM_LOG_ENB_MODULE_CERT          /* Enables Certificate logs */
#define TM_LOG_ENB_MODULE_IKE_STATS     /* Enables IKE Statistics logs */
#define TM_LOG_ENB_MODULE_IPSEC_STATS   /* Enables IPsec Statistics logs */
#define TM_LOG_ENB_MODULE_IPSEC_POLICY  /* Enables IPsec Policy logs */
#define TM_LOG_ENB_MODULE_PRIORITIES    /* Enables Priority processing logs */
#define TM_LOG_ENB_MODULE_IPV4          /* Enables IPv4 logs */
#define TM_LOG_ENB_MODULE_IPV6          /* Enables IPv6 logs */
 

When TM_LOG_ENB_ALL_MODULES is defined, all other modules are automatically defined. As new modules are added through the course of development, this macro will be adjusted to take each into account. For more fine-grained control, however, each individual module of interest can be independently defined in <trsystem.h>.

Enhanced Logging Levels

Logging Levels are classified by nature. They are (optionally) defined in <trsystem.h>:

 
#define TM_LOG_ENB_ALL_LEVELS       /* Enables logging for all Levels */
#define TM_LOG_ENB_LEVEL_ERROR      /* Internal and system configuration errors */ 
#define TM_LOG_ENB_LEVEL_WARNING    /* Problems which do not prohibit system functions */ 
#define TM_LOG_ENB_LEVEL_NOTICE     /* Interesting events which are not necessarily Warnings */ 
#define TM_LOG_ENB_LEVEL_INFO       /* Diagnostic and status information that can be consumed by a user */ 
#define TM_LOG_ENB_LEVEL_DEBUG      /* Information used for debugging and troubleshooting */
 


Enhanced Logging APIs

Enhanced logging can be controlled and output at run-time using the following APIs.


Table of Contents >> IPsec/IKE Programmer's Reference