summaryrefslogtreecommitdiff
path: root/modules/dblog
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-08-29 03:36:27 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-08-29 03:36:27 +0000
commit7c67c8ce209b0c6046e6ca76367958e61b2cb6ea (patch)
tree2ef61674b759c834a120dc8bf51dfca1bce60790 /modules/dblog
parent0092db8e2c64d2bd5bda5fb25b8b8744e63d7b38 (diff)
downloadbrdo-7c67c8ce209b0c6046e6ca76367958e61b2cb6ea.tar.gz
brdo-7c67c8ce209b0c6046e6ca76367958e61b2cb6ea.tar.bz2
#560484 by Davy Van Den Bremt: Allow database logs to never be discarded.
Diffstat (limited to 'modules/dblog')
-rw-r--r--modules/dblog/dblog.module12
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/dblog/dblog.module b/modules/dblog/dblog.module
index 28f7d2f43..3c3ef1cab 100644
--- a/modules/dblog/dblog.module
+++ b/modules/dblog/dblog.module
@@ -93,10 +93,12 @@ function dblog_init() {
*/
function dblog_cron() {
// Cleanup the watchdog table
- $max = db_query('SELECT MAX(wid) FROM {watchdog}')->fetchField();
- db_delete('watchdog')
- ->condition('wid', $max - variable_get('dblog_row_limit', 1000), '<=')
- ->execute();
+ if (variable_get('dblog_row_limit', 1000) > 0) {
+ $max = db_query('SELECT MAX(wid) FROM {watchdog}')->fetchField();
+ db_delete('watchdog')
+ ->condition('wid', $max - variable_get('dblog_row_limit', 1000), '<=')
+ ->execute();
+ }
}
/**
@@ -160,7 +162,7 @@ function dblog_form_system_logging_settings_alter(&$form, $form_state) {
'#type' => 'select',
'#title' => t('Database log entries to keep'),
'#default_value' => variable_get('dblog_row_limit', 1000),
- '#options' => drupal_map_assoc(array(100, 1000, 10000, 100000, 1000000)),
+ '#options' => array(0 => t('All')) + drupal_map_assoc(array(100, 1000, 10000, 100000, 1000000)),
'#description' => t('The maximum number of entries to keep in the database log. Requires a <a href="@cron">cron maintenance task</a>.', array('@cron' => url('admin/reports/status')))
);
$form['buttons']['#weight'] = 1;