diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-04-25 02:27:43 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2018-04-26 12:10:52 +0200 |
commit | cfc3ab0119d23a4c8ccccefb13d2271b0c0675ae (patch) | |
tree | dfab8e9dd20412ce46d21eeb42861854193ca56f /lib/private/Log.php | |
parent | 5fbf184134f34633bc150b2e0210c4a97ec285a9 (diff) | |
download | nextcloud-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/Log.php')
-rw-r--r-- | lib/private/Log.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/private/Log.php b/lib/private/Log.php index c6f676db588..313201460a2 100644 --- a/lib/private/Log.php +++ b/lib/private/Log.php @@ -39,7 +39,8 @@ use InterfaSys\LogNormalizer\Normalizer; use OC\Log\ExceptionSerializer; use OC\Log\IFileBased; -use OC\Log\IWritable; +use OCP\IConfig; +use OCP\Log\IWriter; use OCP\ILogger; use OCP\Support\CrashReport\IRegistry; use OCP\Util; @@ -55,10 +56,10 @@ use OCP\Util; */ class Log implements ILogger { - /** @var IWritable */ + /** @var IWriter */ private $logger; - /** @var SystemConfig */ + /** @var IConfig */ private $config; /** @var boolean|null cache the result of the log condition check for the request */ @@ -71,15 +72,15 @@ class Log implements ILogger { private $crashReporters; /** - * @param IWritable $logger The logger that should be used - * @param SystemConfig $config the system config object + * @param IWriter $logger The logger that should be used + * @param IConfig $config the system config object * @param Normalizer|null $normalizer * @param IRegistry|null $registry */ - public function __construct(IWritable $logger, SystemConfig $config = null, $normalizer = null, IRegistry $registry = null) { + public function __construct(IWriter $logger, IConfig $config = null, $normalizer = null, IRegistry $registry = null) { // FIXME: Add this for backwards compatibility, should be fixed at some point probably if ($config === null) { - $config = \OC::$server->getSystemConfig(); + $config = \OC::$server->getConfig(); } $this->config = $config; @@ -257,7 +258,7 @@ class Log implements ILogger { } if (isset($context['app'])) { - $logCondition = $this->config->getValue('log.condition', []); + $logCondition = $this->config->getSystemValue('log.condition', []); $app = $context['app']; /** @@ -271,7 +272,7 @@ class Log implements ILogger { } } - return min($this->config->getValue('loglevel', ILogger::WARN), ILogger::FATAL); + return min($this->config->getSystemValue('loglevel', ILogger::WARN), ILogger::FATAL); } /** |