diff options
Diffstat (limited to 'lib/private/Server.php')
-rw-r--r-- | lib/private/Server.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php index a4608bf7a8f..05772555a03 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -135,6 +135,7 @@ use OCP\ITempManager; use OCP\Contacts\ContactsMenu\IActionFactory; use OCP\IUser; use OCP\Lock\ILockingProvider; +use OCP\Log\ILogFactory; use OCP\Remote\Api\IApiFactory; use OCP\Remote\IInstanceFactory; use OCP\RichObjectStrings\IValidator; @@ -549,13 +550,18 @@ class Server extends ServerContainer implements IServerContainer { $logType = $c->query('AllConfig')->getSystemValue('log_type', 'file'); $factory = new LogFactory($c); $logger = $factory->get($logType); - $config = $this->getSystemConfig(); + $config = $this->getConfig(); $registry = $c->query(\OCP\Support\CrashReport\IRegistry::class); return new Log($logger, $config, null, $registry); }); $this->registerAlias('Logger', \OCP\ILogger::class); + $this->registerService(ILogFactory::class, function (Server $c) { + return new LogFactory($c); + }); + $this->registerAlias('LogFactory', ILogFactory::class); + $this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) { $config = $c->getConfig(); return new \OC\BackgroundJob\JobList( @@ -1530,6 +1536,14 @@ class Server extends ServerContainer implements IServerContainer { } /** + * @return ILogFactory + * @throws \OCP\AppFramework\QueryException + */ + public function getLogFactory() { + return $this->query('LogFactory'); + } + + /** * Returns a router for generating and matching urls * * @return \OCP\Route\IRouter |