Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
dev:logginevent [2007/10/11 09:06] ravith |
dev:logginevent [2009/07/06 20:36] (current) |
||
---|---|---|---|
Line 22: | Line 22: | ||
)</ | )</ | ||
- | Parameter description. | + | Parameter description. |
- | * data_item_UUID - The UUID of a data item which the log record is related to. (optional) | + | |
- | * comments - A breif log messsage. (required) | + | |
- | * details - A detailed log message. (optional) | + | |
- | * log_level - The log level | + | |
- | * log_sensitivity - The sensitivity of this log message. | + | |
- | * date_time - The date and time in the format returned by php date function - date(" | + | |
- | * module - The name of the module, if not specified (if null) it will be determined from $global[' | + | |
- | * action - The name of the action, if not specified (if null) it will be determined from $global[' | + | |
- | * extra_opts - any extra options as an associate array. This array will be parsed in to key-value pairs in the form of < | + | |
- | There are five levels of logging, namely | + | **There are five levels of logging, namely** |
- | * INFO - Information log records. | + | |
- | * DEBUG - Debugging log records. | + | |
- | * WARN - Warnings | + | |
- | * ERROR - Errors | + | |
- | * FATAL - Fatal Errors | + | |
- | **__//'' | + | **__//'' |
+ | The log level defaults to **INFO**. \\ | ||
- | There are eight levels of log sensitivity. | + | **There are nine levels of log sensitivity.** |
- | The log level defaults to INFO. | + | |
- | * PERSON_SENSITIVE | + | * **PERSON_SENSITIVE** |
- | * ORGANIZATION_SENSITIVE | + | * **ORGANIZATION_SENSITIVE** |
- | * LEAGALLY_SENSITIVE | + | * **LEAGALLY_SENSITIVE** |
- | * NATIONAL_SECURITY_SENSITIVE | + | * **NATIONAL_SECURITY_SENSITIVE** |
- | * SOCIALLY_SENSITIVE | + | * **SOCIALLY_SENSITIVE** |
- | * DISASTER_MITIGATION_SENSITIVE | + | * **DISASTER_MITIGATION_SENSITIVE** |
- | * SYSTEM_SENSITIVE | + | * **SYSTEM_SENSITIVE** |
- | * NOT_SENSITIVE | + | * **NOT_SENSITIVE** |
- | * UNCLASSIFIED | + | * **UNCLASSIFIED** |
- | **__//'' | + | **__//'' |
- | + | The senisitvity level defaults to **NOT_SENSITIVE** \\ | |
- | The senisitvity level defaults to NOT_SENSITIVE | + | |
Line 86: | Line 85: | ||
**//'' | **//'' | ||
- | The default method of logging (to file or to database) can be configured in the sysconf.inc under $conf[' | + | The default method of logging (to file or to database) can be configured in the sysconf.inc under $conf[' |
A custom logger can be created by extending the class Logger and overriding the log_message() function. | A custom logger can be created by extending the class Logger and overriding the log_message() function. | ||
Line 103: | Line 102: | ||
</ | </ | ||
+ | **//'' | ||
+ | The logging API **MUST** be used in the following and similar instances, additionally the module developer is free to use it else where.\\ | ||
+ | \\ | ||
+ | * When a write commit is made to the database | ||
+ | * On a configuration change | ||
+ | * On a important event in the business logic of the module | ||
+ | * On an error | ||
+ | * On a security violation or suspicious action | ||
+ | The log messages should be recorded with the appropriate logging level, and sensitivity level, to make event audit more efficient. | ||
\\ | \\ | ||
**//'' | **//'' | ||
//Ravith Botejue.// | //Ravith Botejue.// |