]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add missing use for LoggerInterface
authorCôme Chilliet <come.chilliet@nextcloud.com>
Thu, 31 Mar 2022 14:25:31 +0000 (16:25 +0200)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Mon, 2 May 2022 08:52:44 +0000 (10:52 +0200)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
apps/dav/lib/HookManager.php
remote.php

index fcb6839a1f9fedd4787b8e3459f14dc034a300cb..f0fdd5cfd4f88cc5e073eaf72ef9a8566ad0f5a8 100644 (file)
@@ -35,6 +35,7 @@ use OCP\Defaults;
 use OCP\IUser;
 use OCP\IUserManager;
 use OCP\Util;
+use Psr\Log\LoggerInterface;
 use Symfony\Component\EventDispatcher\EventDispatcherInterface;
 
 class HookManager {
index 69e3a53eeece7a5ba354d04f2ce5621e5782f0ce..95855fea6ab1183ad1babecc5ed731381ba7d30f 100644 (file)
@@ -36,6 +36,7 @@ require_once __DIR__ . '/lib/versioncheck.php';
 use OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin;
 use Sabre\DAV\Exception\ServiceUnavailable;
 use Sabre\DAV\Server;
+use Psr\Log\LoggerInterface;
 
 /**
  * Class RemoteException
@@ -57,7 +58,7 @@ function handleException($e) {
                $server = new Server();
                if (!($e instanceof RemoteException)) {
                        // we shall not log on RemoteException
-                       $server->addPlugin(new ExceptionLoggerPlugin('webdav', \OC::$server->getLogger()));
+                       $server->addPlugin(new ExceptionLoggerPlugin('webdav', \OC::$server->get(LoggerInterface::class)));
                }
                $server->on('beforeMethod:*', function () use ($e) {
                        if ($e instanceof RemoteException) {
@@ -82,7 +83,7 @@ function handleException($e) {
                        // we shall not log on RemoteException
                        OC_Template::printErrorPage($e->getMessage(), '', $e->getCode());
                } else {
-                       \OC::$server->getLogger()->logException($e, ['app' => 'remote']);
+                       \OC::$server->get(LoggerInterface::class)->error($e->getMessage(), ['app' => 'remote','exception' => $e]);
                        OC_Template::printExceptionErrorPage($e, $statusCode);
                }
        }