summaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/DependencyInjection/DIContainer.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/AppFramework/DependencyInjection/DIContainer.php')
-rw-r--r--lib/private/AppFramework/DependencyInjection/DIContainer.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php
index d45c90a7205..cd426d64699 100644
--- a/lib/private/AppFramework/DependencyInjection/DIContainer.php
+++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php
@@ -45,8 +45,10 @@ use OC\AppFramework\Middleware\Security\CORSMiddleware;
use OC\AppFramework\Middleware\Security\RateLimitingMiddleware;
use OC\AppFramework\Middleware\Security\SecurityMiddleware;
use OC\AppFramework\Middleware\SessionMiddleware;
+use OC\AppFramework\ScopedPsrLogger;
use OC\AppFramework\Utility\SimpleContainer;
use OC\Core\Middleware\TwoFactorMiddleware;
+use OC\Log\PsrLoggerAdapter;
use OC\ServerContainer;
use OCA\WorkflowEngine\Manager;
use OCP\AppFramework\Http\IOutput;
@@ -70,6 +72,7 @@ use OCP\ISession;
use OCP\IURLGenerator;
use OCP\IUserSession;
use Psr\Container\ContainerInterface;
+use Psr\Log\LoggerInterface;
/**
* @deprecated 20.0.0
@@ -128,7 +131,13 @@ class DIContainer extends SimpleContainer implements IAppContainer {
return $this->getServer()->getL10N($c->get('AppName'));
});
- // Log wrapper
+ // Log wrappers
+ $this->registerService(LoggerInterface::class, function (ContainerInterface $c) {
+ return new ScopedPsrLogger(
+ $c->get(PsrLoggerAdapter::class),
+ $c->get('AppName')
+ );
+ });
$this->registerService(ILogger::class, function (ContainerInterface $c) {
return new OC\AppFramework\Logger($this->server->query(ILogger::class), $c->get('AppName'));
});