diff options
-rw-r--r-- | lib/base.php | 2 | ||||
-rw-r--r-- | lib/private/Log/Rotate.php | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/base.php b/lib/base.php index 4a9158eff64..dd0918e7c4c 100644 --- a/lib/base.php +++ b/lib/base.php @@ -881,7 +881,7 @@ class OC { if ($systemConfig->getValue('installed', false) && $systemConfig->getValue('log_rotate_size', false) && !self::checkUpgrade(false)) { //don't try to do this before we are properly setup //use custom logfile path if defined, otherwise use default of nextcloud.log in data directory - \OCP\BackgroundJob::registerJob('OC\Log\Rotate', $systemConfig->getValue('logfile', $systemConfig->getValue('datadirectory', OC::$SERVERROOT . '/data') . '/nextcloud.log')); + \OC::$server->getJobList()->add('OC\Log\Rotate'); } } diff --git a/lib/private/Log/Rotate.php b/lib/private/Log/Rotate.php index 6c87c167378..866068433ff 100644 --- a/lib/private/Log/Rotate.php +++ b/lib/private/Log/Rotate.php @@ -32,7 +32,9 @@ namespace OC\Log; */ class Rotate extends \OC\BackgroundJob\Job { private $max_log_size; - public function run($logFile) { + public function run($dummy) { + $systemConfig = \OC::$server->getSystemConfig(); + $logFile = $systemConfig->getValue('logfile', $systemConfig->getValue('datadirectory', \OC::$SERVERROOT . '/data') . '/nextcloud.log'); $this->max_log_size = \OC::$server->getConfig()->getSystemValue('log_rotate_size', false); if ($this->max_log_size) { $filesize = @filesize($logFile); |