diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2014-12-10 07:05:41 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2014-12-10 07:05:41 +0300 |
commit | 598ce5b5988d53a6d0405c6b346c2d795f00285a (patch) | |
tree | 51b7b597706a74c4bb5ab9345370ac4cbb111932 /config | |
parent | 11adde7767b895b1d04666566ce848815a40ecec (diff) |
#6622 Logger refactoring: Turned the Exception (text) formatter into a processor + added tests
Monolog handlers support 1 formatter. Using processors instead of nested formatters leads to much simpler code.
Diffstat (limited to 'config')
-rw-r--r-- | config/global.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/config/global.php b/config/global.php index e0353fbeb6..933c28daad 100644 --- a/config/global.php +++ b/config/global.php @@ -66,10 +66,12 @@ return array( ), 'Piwik\Log\Handler\FileHandler' => DI\object() ->constructor(DI\link('log.file.filename'), DI\link('log.level')) - ->method('setFormatter', DI\link('Piwik\Log\Formatter\ExceptionTextFormatter')), + ->method('setFormatter', DI\link('Piwik\Log\Formatter\LineMessageFormatter')) + ->method('pushProcessor', DI\link('Piwik\Log\Processor\ExceptionToTextProcessor')), 'Piwik\Log\Handler\DatabaseHandler' => DI\object() ->constructor(DI\link('log.level')) - ->method('setFormatter', DI\link('Piwik\Log\Formatter\ExceptionTextFormatter')), + ->method('setFormatter', DI\link('Piwik\Log\Formatter\LineMessageFormatter')) + ->method('pushProcessor', DI\link('Piwik\Log\Processor\ExceptionToTextProcessor')), 'log.handlers.stdout' => DI\object('Monolog\Handler\StreamHandler') ->constructor('php://output', DI\link('log.level')) ->method('setFormatter', DI\link('Piwik\Log\Formatter\ExceptionHtmlFormatter')), @@ -121,8 +123,6 @@ return array( return $logPath; }), - 'Piwik\Log\Formatter\ExceptionTextFormatter' => DI\object() - ->constructor(DI\link('Piwik\Log\Formatter\LineMessageFormatter')), 'Piwik\Log\Formatter\ExceptionHtmlFormatter' => DI\object() ->constructor(DI\link('Piwik\Log\Formatter\LineMessageFormatter')), 'Piwik\Log\Formatter\LineMessageFormatter' => DI\object() |