watchdog

includes/bootstrap.inc, line 748

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.

▾ 67 functions call 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.
blogapi_blogger_new_post in modules/blogapi/blogapi.module
Blogging API callback. Inserts a new blog post as a node.
book_admin_edit_submit in modules/book/book.module
comment_admin_overview_submit in modules/comment/comment.module
Execute the chosen 'Update option' on the selected comments, such as publishing, unpublishing or deleting.
comment_save in modules/comment/comment.module
Accepts a submission of new or changed comment content.
contact_admin_delete_submit in modules/contact/contact.module
Process category delete form submission.
contact_admin_edit_submit in modules/contact/contact.module
Process the contact category edit page form submission.
contact_mail_page_submit in modules/contact/contact.module
Process the site-wide contact page form submission.
contact_mail_user_submit in modules/contact/contact.module
Process the personal contact page form submission.
drupal_access_denied in includes/common.inc
Generates a 403 error if the request is not allowed.
drupal_client_ping in modules/drupal/drupal.module
Callback function from drupal_xmlrpc() called when another site pings this one.
drupal_convert_to_utf8 in includes/unicode.inc
Convert data to UTF-8
drupal_cron_cleanup in includes/common.inc
Shutdown function for cron cleanup.
drupal_cron_run in includes/common.inc
Executes a cron run when called
drupal_notify in modules/drupal/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/unicode.inc
Prepare a new XML parser.
error_handler in includes/common.inc
Log errors as defined by administrator Error levels: 0 = Log errors to database. 1 = Log errors to database and to screen.
file_check_directory in includes/file.inc
Check that the directory exists and is writable. Directories need to have execute permissions to be considered a directory by FTP servers, etc.
file_check_upload in includes/file.inc
Verify an uploaded file.
file_copy in includes/file.inc
Copies a file to a new location. This is a powerful function that in many ways performs like an advanced version of copy). Checks if $source and $dest are valid and readable/writable. Performs a file copy if $source is not equal to $dest. If file...
filter_form_validate in modules/filter/filter.module
forum_confirm_delete_submit in modules/forum/forum.module
Implementation of forms api _submit call. Deletes a forum after confirmation.
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_manage_delete_form_submit in modules/locale/locale.module
Process language deletion submissions.
menu_edit_item_save in modules/menu/menu.module
Save changes to a menu item into the database.
menu_item_delete_form_submit in modules/menu/menu.module
Process menu delete form submissions.
node_delete in modules/node/node.module
Delete a node.
node_form_submit in modules/node/node.module
node_revision_delete_confirm_submit in modules/node/node.module
node_revision_revert_confirm_submit in modules/node/node.module
node_type_delete_confirm_submit in modules/node/content_types.inc
Process content type delete confirm submissions.
node_type_form_submit in modules/node/content_types.inc
Implementation of hook_form_submit().
ping_ping in modules/ping/ping.module
Implementation of hook_ping().
profile_field_delete_submit in modules/profile/profile.module
Process a field delete form submission.
profile_field_form_submit in modules/profile/profile.module
Process profile_field_form submissions.
search_view in modules/search/search.module
Menu callback; presents the search form and/or search results.
system_update_159 in modules/system/system.install
Retrieve data out of the old_revisions table and put into new revision system.
system_update_169 in modules/system/system.install
system_update_177 in modules/system/system.install
taxonomy_form_term_submit in modules/taxonomy/taxonomy.module
Accept the form submission for a taxonomy term and save the result.
taxonomy_form_vocabulary_submit in modules/taxonomy/taxonomy.module
Accept the form submission for a vocabulary and save the results.
taxonomy_term_confirm_delete_submit in modules/taxonomy/taxonomy.module
taxonomy_vocabulary_confirm_delete_submit in modules/taxonomy/taxonomy.module
throttle_exit in modules/throttle/throttle.module
Implementation of hook_exit().
user_authenticate in modules/user/user.module
user_delete in modules/user/user.module
Delete a user.
user_edit_validate in modules/user/user.module
user_login_submit in modules/user/user.module
user_login_validate in modules/user/user.module
user_logout in modules/user/user.module
Menu callback; logs the current user out, and redirects to the home page.
user_pass_reset in modules/user/user.module
Menu callback; process one time login link and redirects to the user page on success.
user_pass_submit in modules/user/user.module
user_register_submit in modules/user/user.module
user_user_operations in modules/user/user.module
Implementation of hook_user_operations().
_comment_delete_thread in modules/comment/comment.module
_form_validate in includes/form.inc
Performs validation on form elements. First ensures required fields are completed, #maxlength is not exceeded, and selected options were in the list of options given to the user. Then calls user-defined validators.
_locale_add_language in includes/locale.inc
Helper function to add a language
_locale_admin_import_submit in includes/locale.inc
Process the locale import form submission.
_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
_phptemplate_default in themes/engines/phptemplate/phptemplate.engine
Default callback for PHPTemplate.

Code

<?php
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);
  }
}
?>
 
 

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.