watchdog

includes/bootstrap.inc, line 819

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.

See also

watchdog_severity_levels()

Parameters

$type The category to which this message belongs.

$message The message to store in the log. See t() for documentation on how $message and $variables interact. Keep $message translatable by not concatenating dynamic values into it!

$variables Array of variables to replace in the message on display or NULL if message is already translated or not possible to translate.

$severity The severity of the message, as per RFC 3164

$link A link to associate with the message.

▾ 89 functions call watchdog()

actions_do in includes/actions.inc
Perform a given list of actions by executing their callback functions.
actions_save in includes/actions.inc
Save an action and its associated user-supplied parameter values to the database.
actions_synchronize in includes/actions.inc
Synchronize actions that are provided by modules.
aggregator_form_category_submit in modules/aggregator/aggregator.admin.inc
Process aggregator_form_category form submissions.
aggregator_form_feed_submit in modules/aggregator/aggregator.admin.inc
Process aggregator_form_feed form submissions.
aggregator_parse_feed in modules/aggregator/aggregator.module
Parse a feed and store its items.
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.admin.inc
Handle submission of the book administrative page form.
comment_admin_overview_submit in modules/comment/comment.admin.inc
Process comment_admin_overview form submissions.
comment_save in modules/comment/comment.module
Accepts a submission of new or changed comment content.
comment_unpublish_action in modules/comment/comment.module
Drupal action to unpublish a comment.
comment_unpublish_by_keyword_action in modules/comment/comment.module
Implementation of a configurable Drupal action. Unpublish a comment if it contains a certain string.
contact_admin_delete_submit in modules/contact/contact.admin.inc
Process category delete form submission.
contact_admin_edit_submit in modules/contact/contact.admin.inc
Process the contact category edit page form submission.
contact_mail_page_submit in modules/contact/contact.pages.inc
Process the site-wide contact page form submission.
contact_mail_user_submit in modules/contact/contact.pages.inc
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_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_error_handler in includes/common.inc
Log errors as defined by administrator.
drupal_mail in includes/mail.inc
Compose and optionally send an e-mail message.
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.
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_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...
file_save_upload in includes/file.inc
Saves a file upload to a new location. The source file is validated as a proper upload and handled as such.
filter_form_validate in modules/filter/filter.module
forum_confirm_delete_submit in modules/forum/forum.admin.inc
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_add_language in includes/locale.inc
API function to add a language.
locale_languages_delete_form_submit in includes/locale.inc
Process language deletion submissions.
locale_translate_edit_form_validate in includes/locale.inc
Validate string editing form submissions.
locale_translate_import_form_submit in includes/locale.inc
Process the locale import form submission.
locale_update_js_files in modules/locale/locale.module
Update JavaScript translation file, if required, and add it to the page.
menu_delete_menu_confirm_submit in modules/menu/menu.admin.inc
Delete a custom menu and all items in it.
menu_item_delete_form_submit in modules/menu/menu.admin.inc
Process menu delete form submissions.
node_assign_owner_action in modules/node/node.module
Implementation of a configurable Drupal action. Assigns ownership of a node to a user.
node_delete in modules/node/node.module
Delete a node.
node_form_submit in modules/node/node.pages.inc
node_make_sticky_action in modules/node/node.module
Implementation of a Drupal action. Sets the sticky-at-top-of-list property of a node to 1.
node_make_unsticky_action in modules/node/node.module
Implementation of a Drupal action. Sets the sticky-at-top-of-list property of a node to 0.
node_promote_action in modules/node/node.module
Implementation of a Drupal action. Sets the promote property of a node to 1.
node_publish_action in modules/node/node.module
Implementation of a Drupal action. Sets the status of a node to 1, meaning published.
node_revision_delete_confirm_submit in modules/node/node.pages.inc
node_revision_revert_confirm_submit in modules/node/node.pages.inc
node_save_action in modules/node/node.module
Implementation of a Drupal action. Saves a node.
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().
node_unpromote_action in modules/node/node.module
Implementation of a Drupal action. Sets the promote property of a node to 0.
node_unpublish_action in modules/node/node.module
Implementation of a Drupal action. Sets the status of a node to 0, meaning unpublished.
node_unpublish_by_keyword_action in modules/node/node.module
Implementation of a configurable Drupal action. Unpublish a node if it contains a certain string.
ping_ping in modules/ping/ping.module
Implementation of hook_ping().
profile_field_delete_submit in modules/profile/profile.admin.inc
Process a field delete form submission.
profile_field_form_submit in modules/profile/profile.admin.inc
Process profile_field_form submissions.
search_view in modules/search/search.pages.inc
Menu callback; presents the search form and/or search results.
system_actions_delete_form_submit in modules/system/system.module
Process system_actions_delete form submissions.
system_cron in modules/system/system.module
Implementation of hook_cron().
system_send_email_action in modules/system/system.module
Implementation of a configurable Drupal action. Sends an email.
taxonomy_form_term_submit in modules/taxonomy/taxonomy.admin.inc
Submit handler to insert or update a term. See alsotaxonomy_form_term()
taxonomy_form_vocabulary_submit in modules/taxonomy/taxonomy.admin.inc
Accept the form submission for a vocabulary and save the results.
taxonomy_term_confirm_delete_submit in modules/taxonomy/taxonomy.admin.inc
Submit handler to delete a term after confirmation. See alsotaxonomy_term_confirm_delete()
taxonomy_vocabulary_confirm_delete_submit in modules/taxonomy/taxonomy.admin.inc
Submit handler to delete a vocabulary after confirmation. See alsotaxonomy_vocabulary_confirm_delete()
taxonomy_vocabulary_confirm_reset_alphabetical_submit in modules/taxonomy/taxonomy.admin.inc
Submit handler to reset a vocabulary to alphabetical order after confirmation. See alsotaxonomy_vocabulary_confirm_reset_alphabetical()
throttle_exit in modules/throttle/throttle.module
Implementation of hook_exit().
trigger_unassign_submit in modules/trigger/trigger.admin.inc
user_authenticate_finalize in modules/user/user.module
Finalize the login process. Must be called when logging in a user.
user_block_ip_action in modules/user/user.module
Implementation of a Drupal action. Adds an access rule that blocks the user's IP address.
user_block_user_action in modules/user/user.module
Implementation of a Drupal action. Blocks the current user.
user_delete in modules/user/user.module
Delete a user.
user_edit_validate in modules/user/user.pages.inc
user_external_login_register in modules/user/user.module
Helper function for authentication modules. Either login in or registers the current user, based on username. Either way, the global $user object is populated based on $name.
user_login_final_validate in modules/user/user.module
A validate handler on the login form. Should be the last validator. Sets an error if user has not been authenticated yet.
user_logout in modules/user/user.pages.inc
Menu callback; logs the current user out, and redirects to the home page.
user_pass_reset in modules/user/user.pages.inc
Menu callback; process one time login link and redirects to the user page on success.
user_pass_submit in modules/user/user.pages.inc
user_profile_form_validate in modules/user/user.pages.inc
Validation function for the user account and profile editing form.
user_register_submit in modules/user/user.module
Submit handler for the user registration form.
user_user_operations in modules/user/user.module
Implementation of hook_user_operations().
_comment_delete_thread in modules/comment/comment.admin.inc
Perform the actual deletion of a comment and all its replies.
_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_export_po in includes/locale.inc
Write a generated PO or POT file to the output.
_locale_import_po in includes/locale.inc
Parses Gettext Portable Object file information and inserts into database
_locale_rebuild_js in includes/locale.inc
(Re-)Creates the JavaScript translation file for a language.
_menu_router_build in includes/menu.inc
Helper function to build the router table based on the data from hook_menu.
_update_refresh in modules/update/update.fetch.inc
Fetch project info via XML from a central server.

Code

<?php
function watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL) {
  global $user, $base_root;

  // Prepare the fields to be logged
  $log_message = array(
    'type'        => $type,
    'message'     => $message,
    'variables'   => $variables,
    'severity'    => $severity,
    'link'        => $link,
    'user'        => $user,
    'request_uri' => $base_root . request_uri(),
    'referer'     => referer_uri(),
    'ip'          => ip_address(),
    'timestamp'   => time(),
    );

  // Call the logging hooks to log/process the message
  foreach (module_implements('watchdog', TRUE) as $module) {
    module_invoke($module, 'watchdog', $log_message);
  }
}
?>
 
 

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.