VbzCart/tables/event log
Jump to navigation
Jump to search
About
- Purpose: admin error/message log
- Notes:
- This is a log specifically of administration activity (shipping, catalog updates, etc.) so should probably be renamed admin_log or similar. There will be a separate log for shopping activity.
- Have to use "Ev" prefix because When and Where are keywords.
- Decided not to have "WhenStarted" and "WhenFinished" because:
- There are relatively few events that "complete"
- This leaves no place to record completion status (e.g. how many records were affected)
- It makes the code more complicated and less elegant
SQL
<mysql>DROP TABLE IF EXISTS `event_log`;
CREATE TABLE `event_log` (
ID INT NOT NULL AUTO_INCREMENT COMMENT "log line identifier", EvWhen DATETIME NOT NULL COMMENT "when the event started", EvWhere varchar(255) COMMENT "where in the code the event happened (suitable for filtering)", Params varchar(255) COMMENT "any relevant parameters", Descr varchar(255) COMMENT "description of error", Code INT DEFAULT NULL COMMENT "numeric error code unique to location (EvWhere)", VbzUser varchar(127) COMMENT "VbzCart username, for when we have a user system", SysUser varchar(127) COMMENT "who logged into the operating system", Machine varchar(64) COMMENT "network name of machine from which the event was initiated, if applicable", isError BOOL COMMENT "FALSE = this is just a message or normal event; TRUE = there is a problem to fix", isSevere BOOL COMMENT "TRUE = important enough to send email to admin immediately", Notes varchar(255) DEFAULT NULL COMMENT "manually-entered notes", PRIMARY KEY (`ID`) ) ENGINE = MYISAM;</mysql>