diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2014-12-05 05:00:24 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2014-12-05 05:00:24 +0300 |
commit | eaaa66821faf5ef8934822e21ca808d508afe158 (patch) | |
tree | 2142b894db790ac64dbc8a75406c1d9d8ab01082 /config | |
parent | 12ddb7b2db28699d3e7056e38ceaf7b439f04e7b (diff) |
#6622 Logger refactoring: simplified the code and configuration
Diffstat (limited to 'config')
-rw-r--r-- | config/cli.php | 2 | ||||
-rw-r--r-- | config/global.php | 12 |
2 files changed, 5 insertions, 9 deletions
diff --git a/config/cli.php b/config/cli.php index 50c4d5d885..f924c31b20 100644 --- a/config/cli.php +++ b/config/cli.php @@ -24,6 +24,6 @@ return array( $handler->setFormatter(new ConsoleFormatter($c->get('log.console.format'), null, true, true)); return $handler; }), - 'log.console.format' => '%start_tag%%level_name% %extra.class%[%datetime%]%end_tag% %message% %context% %extra%' . PHP_EOL, + 'log.console.format' => '%start_tag%%level_name% %extra.class%[%datetime%]%end_tag% %message%' . PHP_EOL, ); diff --git a/config/global.php b/config/global.php index 46925dd9c6..97b2e8d934 100644 --- a/config/global.php +++ b/config/global.php @@ -4,7 +4,6 @@ use Interop\Container\ContainerInterface; use Piwik\Common; use Piwik\Log; use Piwik\Log\Backend\StdErrBackend; -use Piwik\Log\Formatter\AddRequestIdFormatter; use Piwik\Log\Formatter\ExceptionHtmlFormatter; use Piwik\Log\Formatter\ExceptionTextFormatter; use Piwik\Log\Formatter\LineMessageFormatter; @@ -89,6 +88,7 @@ return array( }), 'log.processors' => array( DI\link('Piwik\Log\Processor\ClassNameProcessor'), + DI\link('Piwik\Log\Processor\RequestIdProcessor'), DI\link('Piwik\Log\Processor\SprintfProcessor'), DI\link('Monolog\Processor\PsrLogMessageProcessor'), ), @@ -134,14 +134,10 @@ return array( return $exceptionFormatter; }), 'log.formatter.html' => DI\factory(function (ContainerInterface $c) { - $lineFormatter = new LineMessageFormatter($c->get('log.format')); - - $addRequestIdFormatter = new AddRequestIdFormatter(); - $addRequestIdFormatter->setNext($lineFormatter); - $exceptionFormatter = new ExceptionHtmlFormatter(); - $exceptionFormatter->setNext($addRequestIdFormatter); - + $exceptionFormatter->setNext( + new LineMessageFormatter($c->get('log.format')) + ); return $exceptionFormatter; }), 'log.format' => DI\factory(function (ContainerInterface $c) { |