diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-04-10 10:10:27 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-04-10 10:10:27 +0000 |
commit | 07e6bdcdfe3273e6a17940c2ba12d2c8e0e878d1 (patch) | |
tree | 377b3a08b74f828e1ac45ad130886e82eccc29a4 /modules/system/system.module | |
parent | ded653fbbd3d8123e5e4ee5a7bd0336519201e61 (diff) | |
download | brdo-07e6bdcdfe3273e6a17940c2ba12d2c8e0e878d1.tar.gz brdo-07e6bdcdfe3273e6a17940c2ba12d2c8e0e878d1.tar.bz2 |
- Patch #63881 by kbahey and jakeg: improved Drupal's logging functionality. Added support for external loggers, and included a small syslog module into core.
Diffstat (limited to 'modules/system/system.module')
-rw-r--r-- | modules/system/system.module | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/modules/system/system.module b/modules/system/system.module index 2df59c8c9..bab509f41 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -249,6 +249,11 @@ function system_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('system_error_reporting_settings'), ); + $items['admin/settings/logging'] = array( + 'title' => t('Logging and alerts'), + 'description' => t('Settings for logging and alerts modules'), + 'page callback' => 'system_logging_overview', + ); $items['admin/settings/performance'] = array( 'title' => t('Performance'), 'description' => t('Enable or disable page caching for anonymous users, and enable or disable CSS preprocessor.'), @@ -669,16 +674,6 @@ function system_error_reporting_settings() { '#description' => t('Where Drupal, PHP and SQL errors are logged. On a production server it is recommended that errors are only written to the error log. On a test server it can be helpful to write logs to the screen.') ); - $period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200), 'format_interval'); - $period['1000000000'] = t('Never'); - $form['watchdog_clear'] = array( - '#type' => 'select', - '#title' => t('Discard log entries older than'), - '#default_value' => variable_get('watchdog_clear', 604800), - '#options' => $period, - '#description' => t('The time log entries should be kept. Older entries will be automatically discarded. Requires crontab.') - ); - return system_settings_form($form); } @@ -1953,6 +1948,14 @@ function system_settings_overview() { return $output; } +function system_logging_overview() { + $item = menu_get_item('admin/settings/logging'); + $content = system_admin_menu_block($item); + + $output = theme('admin_block_content', $content); + + return $output; +} /** * Menu callback; display theme configuration for entire site and individual themes. */ @@ -2431,3 +2434,14 @@ function theme_system_admin_by_module($menu_items) { return $output; } + +/** + * Implementation of hook_cron(). + * + * Remove older rows from flood table + */ +function system_cron() { + // Cleanup the flood + db_query('DELETE FROM {flood} WHERE timestamp < %d', time() - 3600); +} + |