summaryrefslogtreecommitdiffstats
path: root/lib/private/Server.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-04-26 22:58:01 -0300
committerGitHub <noreply@github.com>2017-04-26 22:58:01 -0300
commit01705b1b6a500199796c1d289ae8dd7363c27383 (patch)
treee647526349c54a1d008691b2af0ed95112816220 /lib/private/Server.php
parent0ac806a9dd69eee2ef80bb4d256d3a1355dd36f3 (diff)
parentd0bbae7425e8a39788222dcaab17466c24c3c089 (diff)
downloadnextcloud-server-01705b1b6a500199796c1d289ae8dd7363c27383.tar.gz
nextcloud-server-01705b1b6a500199796c1d289ae8dd7363c27383.zip
Merge pull request #4515 from nextcloud/downstream-27643
Adjust query/event logging code in favour of more complex owncloud/di…
Diffstat (limited to 'lib/private/Server.php')
-rw-r--r--lib/private/Server.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php
index b05e05660b0..25c0b5d9cc9 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -603,22 +603,23 @@ class Server extends ServerContainer implements IServerContainer {
);
});
$this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class);
-
$this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) {
+ $eventLogger = new EventLogger();
if ($c->getSystemConfig()->getValue('debug', false)) {
- return new EventLogger();
- } else {
- return new NullEventLogger();
+ // In debug mode, module is being activated by default
+ $eventLogger->activate();
}
+ return $eventLogger;
});
$this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class);
$this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) {
+ $queryLogger = new QueryLogger();
if ($c->getSystemConfig()->getValue('debug', false)) {
- return new QueryLogger();
- } else {
- return new NullQueryLogger();
+ // In debug mode, module is being activated by default
+ $queryLogger->activate();
}
+ return $queryLogger;
});
$this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class);