summaryrefslogtreecommitdiff
path: root/modules/watchdog/watchdog.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/watchdog/watchdog.module')
-rw-r--r--modules/watchdog/watchdog.module41
1 files changed, 18 insertions, 23 deletions
diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module
index a2be7242c..14c2c17d7 100644
--- a/modules/watchdog/watchdog.module
+++ b/modules/watchdog/watchdog.module
@@ -9,7 +9,7 @@ function watchdog_help($section = 'admin/help#watchdog') {
case 'admin/help#watchdog':
return t('
<p>Watchdog module monitors your web site, capturing system events in a log to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of recorded events containing usage data, performance data, errors, warnings and operational information. It is vital to <a href="%watchdog">check the watchdog report</a> on a regular basis as it is often the only way to tell what is going on.</p>
- <p>To ease administration, the watchdog will automatically discard old log entries, <a href="%log-entry">as configured</a>. Needs "cron.php" to discard the entries.</p>', array('%watchdog' => url('admin/logs'), '%log-entry' => url('admin/system/modules/watchdog')));
+ <p>To ease administration, the watchdog will automatically discard old log entries, <a href="%log-entry">as configured</a>. Needs "cron.php" to discard the entries.</p>', array('%watchdog' => url('admin/logs'), '%log-entry' => url('admin/settings/watchdog')));
case 'admin/logs':
return t('The watchdog module monitors your web site, captures system events in a log and records them to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of events recorded during operation and contains usage data, performance data, errors, warnings and operational information. It is vital to check the watchdog report on a regular basis as it is often the only way to tell what is going on.');
case 'admin/logs/user':
@@ -26,9 +26,9 @@ function watchdog_help($section = 'admin/help#watchdog') {
return t('Watchdog events about PHP and database errors.');
case 'admin/logs/warning':
return t('Watchdog warning events. These events don\'t stop Drupal from running, but are things you should know.');
- case 'admin/system/modules#description':
+ case 'admin/modules#description':
return t('Logs and records system events.');
- case 'admin/system/modules/watchdog':
+ case 'admin/settings/watchdog':
return t('Watchdog logs your system events. To see these events go to the <a href="%watchdog">logs</a>. Since these logs can grow out of control if kept around forever, below set how long an item should be kept in the log. Note that to discard entries as set below you must run "cron.php" regularly.', array('%watchdog' => url('admin/logs')));
}
}
@@ -41,29 +41,24 @@ function watchdog_perm() {
}
/**
- * Implementation of hook_link().
+ * Implementation of hook_menu().
*/
-function watchdog_link($type) {
- if ($type == 'system') {
- menu('admin/logs', t('logs'), user_access('administer watchdog') ? 'watchdog_overview' : MENU_DENIED, 7);
- menu('admin/logs/view', t('view details'), user_access('administer watchdog') ? 'watchdog_view' : MENU_DENIED, 0, MENU_HIDE, MENU_LOCKED);
-
- if (arg(1) == 'logs') {
- foreach (_watchdog_get_message_types() as $type) {
- menu("admin/logs/$type", t($type), MENU_FALLTHROUGH, 0, MENU_SHOW, MENU_LOCKED);
- }
+function watchdog_menu() {
+ $items = array();
+ $items[] = array('path' => 'admin/logs', 'title' => t('logs'),
+ 'callback' => 'watchdog_overview',
+ 'access' => user_access('administer watchdog'));
+ $items[] = array('path' => 'admin/logs/view', 'title' => t('view details'),
+ 'callback' => 'watchdog_view',
+ 'access' => user_access('administer watchdog'),
+ 'type' => MENU_CALLBACK);
+ if (arg(1) == 'logs') {
+ foreach (_watchdog_get_message_types() as $type) {
+ $items[] = array('path' => 'admin/logs/'. $type, 'title' => t($type),
+ 'type' => MENU_DYNAMIC_ITEM);
}
}
-}
-
-/**
- * Implementation of hook_settings().
- */
-function watchdog_settings() {
- $period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200), 'format_interval');
- $period[1000000000] = t('Never');
- $output .= form_select(t('Discard entries older than'), 'watchdog_clear', variable_get('watchdog_clear', 604800), $period, t('The time watchdog entries should be kept. Older entries will be automatically discarded. Requires crontab.'));
- return $output;
+ return $items;
}
/**