ESAPI-C 1.0
The OWASP Enterprise Security API for C
|
Logging module header. More...
Go to the source code of this file.
Defines | |
#define | DEFAULT_LOG_CATEGORY_NAME "root" |
#define | SECURITY_LOG_PREFIX "SECURITY:" |
#define | MAX_MESSAGE_LEN 256 |
Enumerations | |
enum | EVENT_TYPE { SECURITY_SUCCESS, SECURITY_FAILURE, EVENT_SUCCESS, EVENT_FAILURE } |
Functions | |
int | esapi_open_log () |
Enables logging for this process. | |
int | esapi_close_log () |
Disables logging for this process. | |
void | esapi_log_trace (const user *, int, const char *,...) |
Log a TRACE level message. | |
void | esapi_log_debug (const user *, int, const char *,...) |
Log a DEBUG level message. | |
void | esapi_log_info (const user *, int, const char *,...) |
Log an INFO level message. | |
void | esapi_log_warn (const user *, int, const char *,...) |
Log a WARN level message. | |
void | esapi_log_error (const user *, int, const char *,...) |
Log an ERROR level message. | |
void | esapi_log_critical (const user *, int, const char *,...) |
Log a CRITICAL level message. | |
void | esapi_log_fatal (const user *, int, const char *,...) |
Log a FATAL level message. | |
Variables | |
char * | eventTypeNames [] |
Logging module header.
The Logging module defines a set of functions that can be used to log security events. It supports a hierarchy of logging levels which can be configured to determine the severity of events that are logged, and those below the threshold that are discarded. Implementors should use a well established logging library as it is quite difficult to create a high-performance logger.
The logging levels defined by this interface (in descending order) are:
ESAPI also allows for the definition of the type of log event that is being generated. The Logging module predefines 4 types of Log events: SECURITY_SUCCESS, SECURITY_FAILURE, EVENT_SUCCESS, EVENT_FAILURE. Your implementation can extend or change this list if desired.
This Logger allows callers to to submit events at different severity levels.
Implementors of this interface should:
Custom logger implementations might also:
A Log4c based logger is the default implementation. This implementations implements requirements #1 thru #5 above.
Customization: It is expected that most organizations will implement their own custom Logging module in order to integrate ESAPI logging with their logging infrastructure. The ESAPI Reference Implementation is intended to provide a simple functional example of an implementation.
Definition in file log.h.