summaryrefslogtreecommitdiffstats
path: root/lib/private/Server.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2018-04-25 02:27:43 +0200
committerMorris Jobke <hey@morrisjobke.de>2018-04-26 12:10:52 +0200
commitcfc3ab0119d23a4c8ccccefb13d2271b0c0675ae (patch)
treedfab8e9dd20412ce46d21eeb42861854193ca56f /lib/private/Server.php
parent5fbf184134f34633bc150b2e0210c4a97ec285a9 (diff)
downloadnextcloud-server-cfc3ab0119d23a4c8ccccefb13d2271b0c0675ae.tar.gz
nextcloud-server-cfc3ab0119d23a4c8ccccefb13d2271b0c0675ae.zip
offer API to create own File log. admin_audit makes use of it
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/private/Server.php')
-rw-r--r--lib/private/Server.php16
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