aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/Bootstrap
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/AppFramework/Bootstrap')
-rw-r--r--lib/private/AppFramework/Bootstrap/Coordinator.php11
-rw-r--r--lib/private/AppFramework/Bootstrap/RegistrationContext.php46
2 files changed, 24 insertions, 33 deletions
diff --git a/lib/private/AppFramework/Bootstrap/Coordinator.php b/lib/private/AppFramework/Bootstrap/Coordinator.php
index 06a17e5242b..627618f04fa 100644
--- a/lib/private/AppFramework/Bootstrap/Coordinator.php
+++ b/lib/private/AppFramework/Bootstrap/Coordinator.php
@@ -36,8 +36,8 @@ use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\QueryException;
use OCP\Dashboard\IManager;
use OCP\EventDispatcher\IEventDispatcher;
-use OCP\ILogger;
use OCP\IServerContainer;
+use Psr\Log\LoggerInterface;
use Throwable;
use function class_exists;
use function class_implements;
@@ -57,7 +57,7 @@ class Coordinator {
/** @var IEventDispatcher */
private $eventDispatcher;
- /** @var ILogger */
+ /** @var LoggerInterface */
private $logger;
/** @var RegistrationContext|null */
@@ -70,7 +70,7 @@ class Coordinator {
Registry $registry,
IManager $dashboardManager,
IEventDispatcher $eventListener,
- ILogger $logger) {
+ LoggerInterface $logger) {
$this->serverContainer = $container;
$this->registry = $registry;
$this->dashboardManager = $dashboardManager;
@@ -124,9 +124,8 @@ class Coordinator {
try {
$application->register($this->registrationContext->for($appId));
} catch (Throwable $e) {
- $this->logger->logException($e, [
- 'message' => 'Error during app service registration: ' . $e->getMessage(),
- 'level' => ILogger::FATAL,
+ $this->logger->emergency('Error during app service registration: ' . $e->getMessage(), [
+ 'exception' => $e,
]);
}
}
diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
index d056c088a9f..0859e606b7e 100644
--- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php
+++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
@@ -43,10 +43,10 @@ use OCP\Dashboard\IWidget;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Template\ICustomTemplateProvider;
use OCP\Http\WellKnown\IHandler;
-use OCP\ILogger;
use OCP\Notification\INotifier;
use OCP\Search\IProvider;
use OCP\Support\CrashReport\IReporter;
+use Psr\Log\LoggerInterface;
use Throwable;
use function array_shift;
@@ -97,10 +97,10 @@ class RegistrationContext {
/** @var ServiceRegistration<\OCP\Authentication\TwoFactorAuth\IProvider>[] */
private $twoFactorProviders = [];
- /** @var ILogger */
+ /** @var LoggerInterface */
private $logger;
- public function __construct(ILogger $logger) {
+ public function __construct(LoggerInterface $logger) {
$this->logger = $logger;
}
@@ -313,9 +313,8 @@ class RegistrationContext {
->registerCapability($registration->getService());
} catch (Throwable $e) {
$appId = $registration->getAppId();
- $this->logger->logException($e, [
- 'message' => "Error during capability registration of $appId: " . $e->getMessage(),
- 'level' => ILogger::ERROR,
+ $this->logger->error("Error during capability registration of $appId: " . $e->getMessage(), [
+ 'exception' => $e,
]);
}
}
@@ -330,9 +329,8 @@ class RegistrationContext {
$registry->registerLazy($registration->getService());
} catch (Throwable $e) {
$appId = $registration->getAppId();
- $this->logger->logException($e, [
- 'message' => "Error during crash reporter registration of $appId: " . $e->getMessage(),
- 'level' => ILogger::ERROR,
+ $this->logger->error("Error during crash reporter registration of $appId: " . $e->getMessage(), [
+ 'exception' => $e,
]);
}
}
@@ -347,9 +345,8 @@ class RegistrationContext {
$dashboardManager->lazyRegisterWidget($panel->getService());
} catch (Throwable $e) {
$appId = $panel->getAppId();
- $this->logger->logException($e, [
- 'message' => "Error during dashboard registration of $appId: " . $e->getMessage(),
- 'level' => ILogger::ERROR,
+ $this->logger->error("Error during dashboard registration of $appId: " . $e->getMessage(), [
+ 'exception' => $e,
]);
}
}
@@ -365,9 +362,8 @@ class RegistrationContext {
);
} catch (Throwable $e) {
$appId = $registration->getAppId();
- $this->logger->logException($e, [
- 'message' => "Error during event listener registration of $appId: " . $e->getMessage(),
- 'level' => ILogger::ERROR,
+ $this->logger->error("Error during event listener registration of $appId: " . $e->getMessage(), [
+ 'exception' => $e,
]);
}
}
@@ -391,9 +387,8 @@ class RegistrationContext {
);
} catch (Throwable $e) {
$appId = $registration->getAppId();
- $this->logger->logException($e, [
- 'message' => "Error during service registration of $appId: " . $e->getMessage(),
- 'level' => ILogger::ERROR,
+ $this->logger->error("Error during service registration of $appId: " . $e->getMessage(), [
+ 'exception' => $e,
]);
}
}
@@ -408,9 +403,8 @@ class RegistrationContext {
);
} catch (Throwable $e) {
$appId = $registration->getAppId();
- $this->logger->logException($e, [
- 'message' => "Error during service alias registration of $appId: " . $e->getMessage(),
- 'level' => ILogger::ERROR,
+ $this->logger->error("Error during service alias registration of $appId: " . $e->getMessage(), [
+ 'exception' => $e,
]);
}
}
@@ -425,9 +419,8 @@ class RegistrationContext {
);
} catch (Throwable $e) {
$appId = $registration->getAppId();
- $this->logger->logException($e, [
- 'message' => "Error during service alias registration of $appId: " . $e->getMessage(),
- 'level' => ILogger::ERROR,
+ $this->logger->error("Error during service alias registration of $appId: " . $e->getMessage(), [
+ 'exception' => $e,
]);
}
}
@@ -444,9 +437,8 @@ class RegistrationContext {
->registerMiddleWare($middleware->getService());
} catch (Throwable $e) {
$appId = $middleware->getAppId();
- $this->logger->logException($e, [
- 'message' => "Error during capability registration of $appId: " . $e->getMessage(),
- 'level' => ILogger::ERROR,
+ $this->logger->error("Error during capability registration of $appId: " . $e->getMessage(), [
+ 'exception' => $e,
]);
}
}