API:logEvent
API Quick reference
|
Description
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.)
Displays a javascript alert alert message in the web browser
Usage / Examples
Related
Notes
Function Source
API Source File | manager/includes/document.parser.class.inc.php | 1285
# Add an a alert message to the system event log
function logEvent($evtid, $type, $msg, $source= 'Parser') {
$msg= mysql_escape_string($msg);
$source= mysql_escape_string($source);
$evtid= intval($evtid);
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) " .
"VALUES($evtid,$type," . time() . ",'$source','$msg','" . $this->getLoginUserID() . "')";
$ds= $this->dbQuery($sql);
if (!$ds) {
echo "Error while inserting event log into database.";
exit;
}
}