Skip to content

Commit 2b18363

Browse files
committed
add support for nextcloud 10
1 parent 9e215aa commit 2b18363

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

controller/logcontroller.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,14 @@ public function __construct($appName,
4949

5050
private function getLogIterator() {
5151
$dateFormat = $this->config->getSystemValue('logdateformat', \DateTime::ISO8601);
52-
$logClass = class_exists('\OC\Log\Owncloud') ? '\OC\Log\Owncloud' : '\OC_Log_Owncloud';
53-
$handle = fopen($logClass::getLogFilePath(), 'rb');
54-
return new LogIterator($handle, $dateFormat);
52+
$logClasses = ['\OC\Log\Owncloud', '\OC_Log_Owncloud', '\OC\Log\File'];
53+
foreach($logClasses as $logClass) {
54+
if (class_exists($logClass)) {
55+
$handle = fopen($logClass::getLogFilePath(), 'rb');
56+
return new LogIterator($handle, $dateFormat);
57+
}
58+
}
59+
throw new \Exception('Can\'t find log class');
5560
}
5661

5762
/**

0 commit comments

Comments
 (0)