Difference between revisions of "VbzCart/tables/event log"
Jump to navigation
Jump to search
(New page: ==About== * '''Purpose''': admin error/message log * '''Notes''': ** This is a log specifically of administration activity (shipping, catalog updates, etc.) so should probably be renamed a...) |
(ConnMeth field for merging logs) |
||
Line 8: | Line 8: | ||
*** This leaves no place to record completion status (e.g. how many records were affected) | *** This leaves no place to record completion status (e.g. how many records were affected) | ||
*** It makes the code more complicated and less elegant | *** It makes the code more complicated and less elegant | ||
+ | * '''Future''': | ||
+ | ** Add a field called '''ConnMeth''' (connection method) as a VARCHAR(255), and make it part of the primary key. Any code which INSERTs to this table should set this to a string which identifies the server. This will allow merging of event logs from multiple servers. | ||
+ | * '''Related''': | ||
+ | ** Other event logs: {{vbzcart|table|shop_cart_event}}. {{vbzcart|table|ord_event}} | ||
==SQL== | ==SQL== | ||
<section begin=sql /><mysql>DROP TABLE IF EXISTS `event_log`; | <section begin=sql /><mysql>DROP TABLE IF EXISTS `event_log`; |
Revision as of 21:30, 6 September 2009
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
- Future:
- Add a field called ConnMeth (connection method) as a VARCHAR(255), and make it part of the primary key. Any code which INSERTs to this table should set this to a string which identifies the server. This will allow merging of event logs from multiple servers.
- Related:
- Other event logs: shop_cart_event. ord_event
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>