diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php index 617ad18ac14e40474bfce3b05e5fa9c214490d2b..de3c7ccce5e3e8b8ddb335ef7a7bb8665e28dcfc 100644 --- a/apps/files/ajax/list.php +++ b/apps/files/ajax/list.php @@ -81,7 +81,7 @@ try { OCP\JSON::success(array('data' => $data)); } catch (\OCP\Files\StorageNotAvailableException $e) { - \OCP\Util::logException('files', $e); + \OC::$server->getLogger()->logException($e, ['app' => 'files']); OCP\JSON::error([ 'data' => [ 'exception' => StorageNotAvailableException::class, @@ -89,7 +89,7 @@ try { ] ]); } catch (\OCP\Files\StorageInvalidException $e) { - \OCP\Util::logException('files', $e); + \OC::$server->getLogger()->logException($e, ['app' => 'files']); OCP\JSON::error(array( 'data' => array( 'exception' => StorageInvalidException::class, @@ -97,7 +97,7 @@ try { ) )); } catch (\Exception $e) { - \OCP\Util::logException('files', $e); + \OC::$server->getLogger()->logException($e, ['app' => 'files']); OCP\JSON::error(array( 'data' => array( 'exception' => \Exception::class, diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php index 459f9b80e1289a8bcf42dd7372747783b1823b8e..553e5316333e38d28ec32a1bd89d3a21cc01d78b 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -194,7 +194,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { )); $this->testTimeout(); } catch (S3Exception $e) { - \OCP\Util::logException('files_external', $e); + \OC::$server->getLogger()->logException($e, ['app' => 'files_external']); return false; } @@ -261,7 +261,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { // we reached the end when the list is no longer truncated } while ($objects['IsTruncated']); } catch (S3Exception $e) { - \OCP\Util::logException('files_external', $e); + \OC::$server->getLogger()->logException($e, ['app' => 'files_external']); return false; } return true; @@ -305,7 +305,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { return IteratorDirectory::wrap($files); } catch (S3Exception $e) { - \OCP\Util::logException('files_external', $e); + \OC::$server->getLogger()->logException($e, ['app' => 'files_external']); return false; } } @@ -333,7 +333,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { return $stat; } catch (S3Exception $e) { - \OCP\Util::logException('files_external', $e); + \OC::$server->getLogger()->logException($e, ['app' => 'files_external']); return false; } } @@ -343,7 +343,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { try { return $this->isRoot($path) || $this->headObject($path . '/'); } catch (S3Exception $e) { - \OCP\Util::logException('files_external', $e); + \OC::$server->getLogger()->logException($e, ['app' => 'files_external']); return false; } } @@ -363,7 +363,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { return 'dir'; } } catch (S3Exception $e) { - \OCP\Util::logException('files_external', $e); + \OC::$server->getLogger()->logException($e, ['app' => 'files_external']); return false; } @@ -389,7 +389,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { $this->deleteObject($path); $this->invalidateCache($path); } catch (S3Exception $e) { - \OCP\Util::logException('files_external', $e); + \OC::$server->getLogger()->logException($e, ['app' => 'files_external']); return false; } @@ -405,7 +405,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { try { return $this->readObject($path); } catch (S3Exception $e) { - \OCP\Util::logException('files_external', $e); + \OC::$server->getLogger()->logException($e, ['app' => 'files_external']); return false; } case 'w': @@ -483,7 +483,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { $this->testTimeout(); } } catch (S3Exception $e) { - \OCP\Util::logException('files_external', $e); + \OC::$server->getLogger()->logException($e, ['app' => 'files_external']); return false; } @@ -504,7 +504,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { )); $this->testTimeout(); } catch (S3Exception $e) { - \OCP\Util::logException('files_external', $e); + \OC::$server->getLogger()->logException($e, ['app' => 'files_external']); return false; } } else { @@ -518,7 +518,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { )); $this->testTimeout(); } catch (S3Exception $e) { - \OCP\Util::logException('files_external', $e); + \OC::$server->getLogger()->logException($e, ['app' => 'files_external']); return false; } @@ -591,7 +591,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { unlink($tmpFile); return true; } catch (S3Exception $e) { - \OCP\Util::logException('files_external', $e); + \OC::$server->getLogger()->logException($e, ['app' => 'files_external']); return false; } } diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 5238eaa42b27e22bd51c560cc1b8548c5f886bf6..a1e7d12bcaec65d0db517956d65def2a2dbbee5d 100644 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -247,7 +247,7 @@ class OC_Mount_Config { throw $e; } } catch (Exception $exception) { - \OCP\Util::logException('files_external', $exception); + \OC::$server->getLogger()->logException($exception, ['app' => 'files_external']); throw $exception; } } diff --git a/lib/base.php b/lib/base.php index f0e139d92c8e8d5d6de26e52b82d019e4b57e72a..0c78d235c59401c34de7620ab773a9e26cf9d779 100644 --- a/lib/base.php +++ b/lib/base.php @@ -426,7 +426,7 @@ class OC { // if session can't be started break with http 500 error } catch (Exception $e) { - \OCP\Util::logException('base', $e); + \OC::$server->getLogger()->logException($e, ['app' => 'base']); //show the user a detailed error page OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); OC_Template::printExceptionErrorPage($e);