VbzCart/tables/event log

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< VbzCart‎ | tables
Revision as of 21:30, 6 September 2009 by Woozle (talk | contribs) (ConnMeth field for merging logs)
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
  • 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:

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>