Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorMatthieu Napoli <matthieu@mnapoli.fr>2014-12-05 01:40:32 +0300
committerMatthieu Napoli <matthieu@mnapoli.fr>2014-12-05 01:40:32 +0300
commit2ffa749ea2057bbaeeef59f0e08cc2c288cbbfb9 (patch)
tree1a73b5831ee1d9543b23e7f3d02f06f9c946a584 /config
parent28a07a8d13a05f923b3d231283261e484078de72 (diff)
#6622 Logger refactoring: using Monolog!
`Piwik\Log` is now a wrapper on top of Monolog. The real logger can now be injected using `Psr\Log\LoggerInterface`.
Diffstat (limited to 'config')
-rw-r--r--config/global.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/config/global.php b/config/global.php
index 122428a07e..8c631c41f4 100644
--- a/config/global.php
+++ b/config/global.php
@@ -31,8 +31,10 @@ return array(
}),
// Log
+ 'Psr\Log\LoggerInterface' => DI\object('Monolog\Logger')
+ ->constructor('piwik', DI\link('log.handlers'), DI\link('log.processors')),
'Piwik\Log' => DI\object()
- ->constructor(DI\link('log.handlers'), DI\link('log.level.piwik'), DI\link('log.processors')),
+ ->constructor(DI\link('Psr\Log\LoggerInterface')),
'log.level.monolog' => DI\factory(function (ContainerInterface $c) {
return Log::getMonologLevel($c->get('log.level.piwik'));
}),
@@ -86,7 +88,7 @@ return array(
$isLoggingToStdOut = isset($writers['screen']);
$writers['stderr'] = new StdErrBackend($c->get('log.formatter.html'), $isLoggingToStdOut);
- return $writers;
+ return array_values($writers);
}),
'log.processors' => array(
DI\link('Piwik\Log\Processor\ClassNameProcessor'),