diff --git a/3rdparty b/3rdparty index 338ab170afc..3cd7b7048e3 160000 --- a/3rdparty +++ b/3rdparty @@ -1 +1 @@ -Subproject commit 338ab170afcb4770e79cc4427a9803cb29a0a230 +Subproject commit 3cd7b7048e33e0076c1f94cf2ed721934e0c4977 diff --git a/lib/private/log.php b/lib/private/log.php index 3c0e7b45d1b..3c8149bc1d0 100644 --- a/lib/private/log.php +++ b/lib/private/log.php @@ -3,6 +3,7 @@ * @author Bart Visscher * @author Bernhard Posselt * @author Morris Jobke + * @author Olivier Paroz * @author Robin Appelman * @author Thomas Müller * @author Victor Dubiniuk @@ -26,6 +27,8 @@ namespace OC; +use InterfaSys\LogNormalizer\Normalizer; + use \OCP\ILogger; use OCP\Security\StringUtils; @@ -48,12 +51,15 @@ class Log implements ILogger { /** @var boolean|null cache the result of the log condition check for the request */ private $logConditionSatisfied = null; + /** @var Normalizer */ + private $normalizer; /** * @param string $logger The logger that should be used * @param SystemConfig $config the system config object + * @param null $normalizer */ - public function __construct($logger=null, SystemConfig $config=null) { + public function __construct($logger=null, SystemConfig $config=null, $normalizer = null) { // FIXME: Add this for backwards compatibility, should be fixed at some point probably if($config === null) { $config = \OC::$server->getSystemConfig(); @@ -68,6 +74,11 @@ class Log implements ILogger { } else { $this->logger = $logger; } + if ($normalizer === null) { + $this->normalizer = new Normalizer(); + } else { + $this->normalizer = $normalizer; + } } @@ -175,6 +186,8 @@ class Log implements ILogger { $minLevel = min($this->config->getValue('loglevel', \OCP\Util::WARN), \OCP\Util::ERROR); $logCondition = $this->config->getValue('log.condition', []); + array_walk($context, [$this->normalizer, 'format']); + if (isset($context['app'])) { $app = $context['app'];