diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2020-04-08 11:49:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-08 11:49:56 +0200 |
commit | 547ba642c6a3e9ef2557e4e73c8e6fceca8292ec (patch) | |
tree | 8249e1165b0cd52ac30383d3b02fed382df06fd2 /lib/private/Server.php | |
parent | bb937999fa3aeea7631a6e18031fad802af4a9bb (diff) | |
parent | 1b4380aae87d30aab16e2fd5c2d04372a246fa39 (diff) | |
download | nextcloud-server-547ba642c6a3e9ef2557e4e73c8e6fceca8292ec.tar.gz nextcloud-server-547ba642c6a3e9ef2557e4e73c8e6fceca8292ec.zip |
Merge pull request #18200 from nextcloud/enhancement/psr-logger
Add a PSR-3 logger adapter and make it injectable
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 c7a30e3c9f8..4e62e2d2916 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -104,6 +104,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; @@ -225,6 +226,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; @@ -723,6 +725,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()); |