You are here

function watchdog_rules_tokens in Logging and alerts 7

Same name and namespace in other branches
  1. 7.2 watchdog_rules/watchdog_rules.module \watchdog_rules_tokens()

Implements hook_tokens().

File

watchdog_rules/watchdog_rules.module, line 77
Provides a Rules integration for wachdog events.

Code

function watchdog_rules_tokens($type, $object = NULL, $options = array()) {
  $tokens = array();
  if ($type == 'watchdog' || $type == 'all') {
    $tokens = array(
      'type' => $object['type'],
      'request_uri' => $object['request_uri'],
      'referer' => $object['referer'],
      'ip' => $object['ip'],
      'timestamp' => $object['timestamp'],
      'severity' => $object['severity'],
      'link' => $object['link'],
      'message' => $object['message'],
    );
    return $tokens;
  }
}