diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-12-03 10:16:28 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 10:52:10 +0100 |
commit | 1b4380aae87d30aab16e2fd5c2d04372a246fa39 (patch) | |
tree | 52cda1c51e1d70eb73d9ee042d7ce77e202e0d57 /lib/private/Server.php | |
parent | 25ab122245da1456701d93d7178f851b660c3cf7 (diff) | |
download | nextcloud-server-1b4380aae87d30aab16e2fd5c2d04372a246fa39.tar.gz nextcloud-server-1b4380aae87d30aab16e2fd5c2d04372a246fa39.zip |
Add a PSR-3 logger adapter and make it injectable
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/Server.php')
-rw-r--r-- | lib/private/Server.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php index 971b144e1d0..5c32b3e98e2 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -101,6 +101,7 @@ use OC\Lock\MemcacheLockingProvider; use OC\Lock\NoopLockingProvider; use OC\Lockdown\LockdownManager; use OC\Log\LogFactory; +use OC\Log\PsrLoggerAdapter; use OC\Mail\Mailer; use OC\Memcache\ArrayCache; use OC\Memcache\Factory; @@ -222,6 +223,7 @@ use OCP\User\Events\UserDeletedEvent; use OCP\User\Events\UserLoggedInEvent; use OCP\User\Events\UserLoggedInWithCookieEvent; use OCP\User\Events\UserLoggedOutEvent; +use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\GenericEvent; use OCA\Files_External\Service\UserStoragesService; @@ -720,6 +722,8 @@ class Server extends ServerContainer implements IServerContainer { }); $this->registerAlias(ILogger::class, \OC\Log::class); $this->registerDeprecatedAlias('Logger', \OC\Log::class); + // PSR-3 logger + $this->registerAlias(LoggerInterface::class, PsrLoggerAdapter::class); $this->registerService(ILogFactory::class, function (Server $c) { return new LogFactory($c, $this->getSystemConfig()); |