function watchdog

cis7 watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL)
cle7 watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL)
elmsmedia7 watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL)
icor7 watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL)
meedjum_blog7 watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL)
mooc7 watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL)

Logs a system message.


$type: The category to which this message belongs. Can be any string, but the general practice is to use the name of the module calling watchdog().

$message: The message to store in the log. Keep $message translatable by not concatenating dynamic values into it! Variables in the message should be added by using placeholder strings alongside the variables argument to declare the value of the placeholders. See t() for documentation on how $message and $variables interact.

$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; one of the following values as defined in RFC 3164:

$link: A link to associate with the message.

See also



230 calls to watchdog()
accessibility_test_delete_form_submit in sites/all/modules/ulmus/accessibility/accessibility.module
Submit callback for model_delete_form
actions_do in includes/
Performs a given list of actions by executing their callback functions.
actions_save in includes/
Saves an action and its user-supplied parameter values to the database.
actions_synchronize in includes/
Synchronizes actions that are provided by modules in hook_action_info().
advagg_js_compress_jsminplus in sites/all/modules/ulmus/advagg/advagg_js_compress/
Compress a JS string using jsmin+.

... See full list

33 string references to 'watchdog'
actions_loop_test_trigger_info in modules/simpletest/tests/actions_loop_test.module
Implements hook_trigger_info().
actions_loop_test_watchdog in modules/simpletest/tests/actions_loop_test.module
Implements hook_watchdog().
backtrace_error_handler in sites/all/modules/ulmus/devel/devel.module
Displays backtrace showing the route of calls to the current error.
backup_migrate_destination_db::backup_settings_default in sites/all/modules/ulmus/backup_migrate/includes/
Get the form for the settings for this destination.
bootstrap_hooks in includes/
Defines the critical hooks that force modules to always be loaded.

... See full list


includes/, line 1704
Functions that need to be loaded on every Drupal request.


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

  static $in_error_state = FALSE;

  // It is possible that the error handling will itself trigger an error. In that case, we could
  // end up in an infinite loop. To avoid that, we implement a simple static semaphore.
  if (!$in_error_state && function_exists('module_implements')) {
    $in_error_state = TRUE;

    // The user object may not exist in all conditions, so 0 is substituted if needed.
    $user_uid = isset($user->uid) ? $user->uid : 0;

    // Prepare the fields to be logged
    $log_entry = array(
      'type' => $type,
      'message' => $message,
      'variables' => $variables,
      'severity' => $severity,
      'link' => $link,
      'user' => $user,
      'uid' => $user_uid,
      'request_uri' => $base_root . request_uri(),
      'referer' => isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '',
      'ip' => ip_address(),
      // Request time isn't accurate for long processes, use time() instead.
      'timestamp' => time(),

    // Call the logging hooks to log/process the message
    foreach (module_implements('watchdog') as $module) {
      module_invoke($module, 'watchdog', $log_entry);

    // It is critical that the semaphore is only cleared here, in the parent
    // watchdog() call (not outside the loop), to prevent recursive execution.
    $in_error_state = FALSE;



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.