watchdog_menu

5 watchdog.module watchdog_menu($may_cache)

Implementation of hook_menu().

File

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

Code

function watchdog_menu($may_cache) {
  $items = array();

  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/logs/watchdog', 
      'title' => t('Recent log entries'), 
      'description' => t('View events that have recently been logged.'), 
      'callback' => 'watchdog_overview', 
      'weight' => -1,
    );
    $items[] = array(
      'path' => 'admin/logs/page-not-found', 
      'title' => t("Top 'page not found' errors"), 
      'description' => t("View 'page not found' errors (404s)."), 
      'callback' => 'watchdog_top', 
      'callback arguments' => array('page not found'),
    );
    $items[] = array(
      'path' => 'admin/logs/access-denied', 
      'title' => t("Top 'access denied' errors"), 
      'description' => t("View 'access denied' errors (403s)."), 
      'callback' => 'watchdog_top', 
      'callback arguments' => array('access denied'),
    );
    $items[] = array(
      'path' => 'admin/logs/event', 
      'title' => t('Details'), 
      'callback' => 'watchdog_event', 
      'type' => MENU_CALLBACK,
    );
  }
  else {
    if (arg(0) == 'admin' && arg(1) == 'logs') {
      // Add the CSS for this module
      drupal_add_css(drupal_get_path('module', 'watchdog') . '/watchdog.css', 'module', 'all', FALSE);
    }
  }

  return $items;
}
Login or register to post comments