watchdog

Definition

watchdog($type, $message, $severity = WATCHDOG_NOTICE, $link = NULL)
includes/bootstrap.inc, line 584

Description

Log a system message.

Parameters

$type The category to which this message belongs.

$message The message to store in the log.

$severity The severity of the message. One of the following values:

  • WATCHDOG_NOTICE
  • WATCHDOG_WARNING
  • WATCHDOG_ERROR
$link A link to associate with the message.

Code

<?php
function watchdog($type, $message, $severity = WATCHDOG_NOTICE, $link = NULL) {
  global $user;
  db_query("INSERT INTO {watchdog} (uid, type, message, severity, link, location, hostname, timestamp) VALUES (%d, '%s', '%s', %d, '%s', '%s', '%s', %d)", $user->uid, $type, $message, $severity, $link, request_uri(), $_SERVER['REMOTE_ADDR'], time());
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.