]> source.dussan.org Git - nextcloud-server.git/commitdiff
Get the logfile location while running the logrotate cron job instead of when registe... 2914/head
authorRobin Appelman <robin@icewind.nl>
Mon, 2 Jan 2017 15:16:15 +0000 (16:16 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Fri, 6 Jan 2017 15:10:07 +0000 (16:10 +0100)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/base.php
lib/private/Log/Rotate.php

index 4a9158eff64bd75bb1d69fd0cc691c694f5ea5b7..dd0918e7c4cae0a6fbfc8d85dff406c3c7919646 100644 (file)
@@ -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');
                }
        }
 
index 6c87c16737832c64ef344f259d32f6eb927230fb..866068433ffe09b9f7bf7c6d63c1bd1a8904357d 100644 (file)
@@ -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);