watchdog_event

5 watchdog.module watchdog_event($id)

Menu callback; displays details about a log message.

1 string reference to 'watchdog_event'

File

modules/watchdog.module, line 161
System monitoring and logging for administrators.

Code

function watchdog_event($id) {
  $severity = array(
    WATCHDOG_NOTICE => t('notice'),
    WATCHDOG_WARNING => t('warning'),
    WATCHDOG_ERROR => t('error'),
  );
  $output = '';
  $result = db_query('SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid WHERE w.wid = %d', $id);
  if ($watchdog = db_fetch_object($result)) {
    $header = array(t('Type'), t('Date'), t('User'), t('Location'), t('Referrer'), t('Message'), t('Severity'), t('Hostname'));
    $data = array(t($watchdog->type), format_date($watchdog->timestamp, 'large'), theme('username', $watchdog), l($watchdog->location, $watchdog->location), l($watchdog->referer, $watchdog->referer), $watchdog->message, $severity[$watchdog->severity], $watchdog->hostname);
    $output = theme('watchdog_event', $header, $data);
  }
  return $output;
}
Login or register to post comments