You are here

function statsd_watchdog in StatsD 7.2

Same name and namespace in other branches
  1. 6 statsd.module \statsd_watchdog()
  2. 7 statsd.module \statsd_watchdog()

Implementation of hook_watchdog()

File

./statsd.module, line 95

Code

function statsd_watchdog($entry) {
  if (strstr($entry['message'], 'Login attempt failed for')) {
    statsd_user_login_failed($entry['user']);
  }
  $enabled = variable_get('statsd_watchdog_events', TRUE);
  $level = variable_get('statsd_watchdog_level', WATCHDOG_WARNING);
  if (!$enabled || $level < $entry['severity']) {
    return;
  }
  $levels = watchdog_severity_levels();
  $data = array(
    sprintf('watchdog.type.%s', $entry['type']),
    sprintf('watchdog.severity.%s', $levels[$entry['severity']]),
  );
  statsd_call($data);
}