watchdog

includes/bootstrap.inc, line 584

Versions
4.6 – 5
watchdog($type, $message, $severity = WATCHDOG_NOTICE, $link = NULL)
6 – 7
watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL)

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.

▾ 37 functions call watchdog()

aggregator_parse_feed in modules/aggregator.module
aggregator_refresh in modules/aggregator.module
Checks a news feed for new items.
blogapi_blogger_edit_post in modules/blogapi.module
Blogging API callback. Modifies the specified blog node.
blogapi_blogger_new_post in modules/blogapi.module
Blogging API callback. Inserts a new blog post as a node.
book_admin_save in modules/book.module
comment_post in modules/comment.module
comment_save in modules/comment.module
contact_mail_user in modules/contact.module
drupal_access_denied in includes/common.inc
Generates a 403 error if the request is not allowed.
drupal_convert_to_utf8 in includes/common.inc
Convert data to UTF-8
drupal_directory_ping in modules/drupal.module
Callback function from drupal_xmlrpc() called when another site pings this one.
drupal_notify in modules/drupal.module
Sends a ping to the Drupal directory server.
drupal_not_found in includes/common.inc
Generates a 404 error if the request can not be handled.
drupal_xml_parser_create in includes/common.inc
Prepare a new XML parser.
error_handler in includes/common.inc
Log errors as defined by administrator Error levels: 1 = Log errors to database. 2 = Log errors to database and to screen.
file_check_directory in includes/file.inc
Check that directory exists and is writable.
hook_ping in developer/hooks/core.php
Ping another server.
image_toolkit_invoke in includes/image.inc
Invokes the given method using the currently selected toolkit.
locale_admin_import in modules/locale.module
Page handler for the translation import screen
locale_admin_manage_delete_screen in modules/locale.module
User interface for the language deletion confirmation screen
node_delete in modules/node.module
Ask for confirmation, and delete the node.
node_submit in modules/node.module
Accepts a submission of new or changed node content.
ping_ping in modules/ping.module
Implementation of hook_ping().
queue_vote in modules/queue.module
search_view in modules/search.module
Menu callback; presents the search form and/or search results.
throttle_exit in modules/throttle.module
Implementation of hook_exit().
user_admin_create in modules/user.module
user_authenticate in modules/user.module
user_edit in modules/user.module
user_login in modules/user.module
user_logout in modules/user.module
Menu callback; logs the current user out, and redirects to the home page.
user_pass in modules/user.module
user_register in modules/user.module
_comment_delete_thread in modules/comment.module
_locale_add_language in includes/locale.inc
Helper function to add a language
_locale_export_po in includes/locale.inc
Exports a Portable Object (Template) file for a language
_locale_import_po in includes/locale.inc
Parses Gettext Portable Object file information and inserts into database

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.