API:logEvent
From MODx Wiki
API Function Definition:
logEvent
- Versions
- > 0.9.2 ?
- Return Values
- Success: null
- Fail: echo error and exit()
- Data Type
- void
- Object Hierarchy
- DocumentParser
void logEvent(int $evtid, int $type, string $msg [, $source= 'Parser']);
- $evtid - Event ID
- $type - types: 1 = information, 2 = warning, 3 = error
- $msg - message to be logged
- $source - source of the event (module, snippet name, etc.)
[edit]
Examples
[edit]
Related Functions
[edit]
Function Source
| File: | manager/includes/document.parser.class.inc.php |
|---|---|
| Line: | 1285 |
# Add an a alert message to the system event log function logEvent($evtid, $type, $msg, $source= 'Parser') { if ($type < 1) $type= 1; else if ($type > 3) $type= 3; // Types: 1 = information, 2 = warning, 3 = error $sql= "INSERT INTO " . $this->getFullTableName("event_log") . "(eventid,type,createdon,source,description,user) " . $ds= $this->dbQuery($sql); if (!$ds) { echo "Error while inserting event log into database."; exit; } }
[edit]
