You are here

function watchdog in Drupal 5

Same name and namespace in other branches
  1. 4 includes/bootstrap.inc \watchdog()
  2. 6 includes/bootstrap.inc \watchdog()
  3. 7 includes/bootstrap.inc \watchdog()

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:

$link: A link to associate with the message.

66 calls to watchdog()
aggregator_form_category_submit in modules/aggregator/aggregator.module
Process aggregator_form_category form submissions. @todo Add delete confirmation dialog.
aggregator_form_feed_submit in modules/aggregator/aggregator.module
Process aggregator_form_feed form submissions. @todo Add delete confirmation dialog.
aggregator_parse_feed in modules/aggregator/aggregator.module
aggregator_refresh in modules/aggregator/aggregator.module
Checks a news feed for new items.
blogapi_blogger_edit_post in modules/blogapi/blogapi.module
Blogging API callback. Modifies the specified blog node.

... See full list

8 string references to 'watchdog'
default_profile_modules in profiles/default/default.profile
Return an array of the modules to be enabled when this profile is installed.
system_modules in modules/system/system.module
Menu callback; provides module enable/disable interface.
system_update_1016 in modules/system/system.install
Allow for longer URL encoded (%NN) UTF-8 characters in the location field of watchdog table.
system_update_162 in modules/system/system.install
system_update_169 in modules/system/system.install

... See full list

File

includes/bootstrap.inc, line 748
Functions that need to be loaded on every Drupal request.

Code

function watchdog($type, $message, $severity = WATCHDOG_NOTICE, $link = NULL) {
  global $user, $base_root;
  $current_db = db_set_active();

  // Note: log the exact, entire absolute URL.
  $request_uri = $base_root . request_uri();
  db_query("INSERT INTO {watchdog} (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (%d, '%s', '%s', %d, '%s', '%s', '%s', '%s', %d)", $user->uid, $type, $message, $severity, $link, $request_uri, referer_uri(), $_SERVER['REMOTE_ADDR'], time());
  if ($current_db) {
    db_set_active($current_db);
  }
}