diff options
Diffstat (limited to 'apps/federation/lib/Middleware/AddServerMiddleware.php')
-rw-r--r-- | apps/federation/lib/Middleware/AddServerMiddleware.php | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/apps/federation/lib/Middleware/AddServerMiddleware.php b/apps/federation/lib/Middleware/AddServerMiddleware.php index de6f7786679..de964f1bd4a 100644 --- a/apps/federation/lib/Middleware/AddServerMiddleware.php +++ b/apps/federation/lib/Middleware/AddServerMiddleware.php @@ -35,25 +35,14 @@ use OCP\AppFramework\Http\JSONResponse; use OCP\AppFramework\Middleware; use OCP\HintException; use OCP\IL10N; -use OCP\ILogger; +use Psr\Log\LoggerInterface; class AddServerMiddleware extends Middleware { + protected string $appName; + protected IL10N $l; + protected LoggerInterface $logger; - /** @var string */ - protected $appName; - - /** @var IL10N */ - protected $l; - - /** @var ILogger */ - protected $logger; - - /** - * @param string $appName - * @param IL10N $l - * @param ILogger $logger - */ - public function __construct($appName, IL10N $l, ILogger $logger) { + public function __construct(string $appName, IL10N $l, LoggerInterface $logger) { $this->appName = $appName; $this->l = $l; $this->logger = $logger; @@ -72,9 +61,9 @@ class AddServerMiddleware extends Middleware { if (($controller instanceof SettingsController) === false) { throw $exception; } - $this->logger->logException($exception, [ - 'level' => ILogger::ERROR, + $this->logger->error($exception->getMessage(), [ 'app' => $this->appName, + 'exception' => $exception, ]); if ($exception instanceof HintException) { $message = $exception->getHint(); |