aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorMatt Beckett <beck24@gmail.com>2013-03-19 21:27:47 -0600
committerMatt Beckett <beck24@gmail.com>2013-03-19 21:27:47 -0600
commitde9e434c2b1e606873beaee4d6e8b851a8f59fdb (patch)
treecb90677d680fa690bcbbe584ad756f02d135b46a /mod
parent36755bea9aefd7e8bf54deab7b29902f8733f9aa (diff)
downloadelgg-de9e434c2b1e606873beaee4d6e8b851a8f59fdb.tar.gz
elgg-de9e434c2b1e606873beaee4d6e8b851a8f59fdb.tar.bz2
Allow logs to rotate without being deleted
Diffstat (limited to 'mod')
-rw-r--r--mod/logrotate/languages/en.php1
-rw-r--r--mod/logrotate/start.php7
-rw-r--r--mod/logrotate/views/default/plugins/logrotate/settings.php1
3 files changed, 7 insertions, 2 deletions
diff --git a/mod/logrotate/languages/en.php b/mod/logrotate/languages/en.php
index 27731d732..3af83e553 100644
--- a/mod/logrotate/languages/en.php
+++ b/mod/logrotate/languages/en.php
@@ -20,6 +20,7 @@ $english = array(
'logrotate:week' => 'week',
'logrotate:month' => 'month',
'logrotate:year' => 'year',
+ 'logrotate:never' => 'never',
'logrotate:logdeleted' => "Log deleted\n",
'logrotate:lognotdeleted' => "Error deleting log\n",
diff --git a/mod/logrotate/start.php b/mod/logrotate/start.php
index 28f14ad14..313cf1fd5 100644
--- a/mod/logrotate/start.php
+++ b/mod/logrotate/start.php
@@ -21,8 +21,11 @@ function logrotate_init() {
// Register cron hook for archival of logs
elgg_register_plugin_hook_handler('cron', $period, 'logrotate_archive_cron');
- // Register cron hook for deletion of selected archived logs
- elgg_register_plugin_hook_handler('cron', $delete, 'logrotate_delete_cron');
+
+ if ($delete != 'never') {
+ // Register cron hook for deletion of selected archived logs
+ elgg_register_plugin_hook_handler('cron', $delete, 'logrotate_delete_cron');
+ }
}
/**
diff --git a/mod/logrotate/views/default/plugins/logrotate/settings.php b/mod/logrotate/views/default/plugins/logrotate/settings.php
index bef8b308d..9fd3e08df 100644
--- a/mod/logrotate/views/default/plugins/logrotate/settings.php
+++ b/mod/logrotate/views/default/plugins/logrotate/settings.php
@@ -40,6 +40,7 @@ if (!$delete) {
'weekly' => elgg_echo('logrotate:week'),
'monthly' => elgg_echo('logrotate:month'),
'yearly' => elgg_echo('logrotate:year'),
+ 'never' => elgg_echo('logrotate:never'),
),
'value' => $delete,
));