diff options
author | Salvatore Martire <4652631+salmart-dev@users.noreply.github.com> | 2025-06-06 16:28:15 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2025-06-24 08:28:21 +0000 |
commit | 258ab93441b1f322f12fafcbd7be2ccee9463622 (patch) | |
tree | 8f4ed87bfa9fcedec121aeb6aba6f50bcd3bc0ae | |
parent | f3ce7a9ba5f3358809fa4c5e76afbe92fb6a42bb (diff) | |
download | nextcloud-server-backport/53420/stable30.tar.gz nextcloud-server-backport/53420/stable30.zip |
fix: make rotate logs a TimedJob and run every hourbackport/53420/stable30
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
-rw-r--r-- | lib/private/Log/Rotate.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/Log/Rotate.php b/lib/private/Log/Rotate.php index f2fdb83623d..efe1fccd50e 100644 --- a/lib/private/Log/Rotate.php +++ b/lib/private/Log/Rotate.php @@ -7,6 +7,8 @@ */ namespace OC\Log; +use OCP\AppFramework\Utility\ITimeFactory; +use OCP\BackgroundJob\TimedJob; use OCP\IConfig; use OCP\Log\RotationTrait; use Psr\Log\LoggerInterface; @@ -17,9 +19,15 @@ use Psr\Log\LoggerInterface; * For more professional log management set the 'logfile' config to a different * location and manage that with your own tools. */ -class Rotate extends \OCP\BackgroundJob\Job { +class Rotate extends TimedJob { use RotationTrait; + public function __construct(ITimeFactory $time) { + parent::__construct($time); + + $this->setInterval(3600); + } + public function run($argument): void { $config = \OCP\Server::get(IConfig::class); $this->filePath = $config->getSystemValueString('logfile', $config->getSystemValueString('datadirectory', \OC::$SERVERROOT . '/data') . '/nextcloud.log'); |