diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2019-03-20 13:09:31 +0300 |
---|---|---|
committer | Stefan Giehl <stefan@matomo.org> | 2019-03-20 13:09:31 +0300 |
commit | 54e87e566a1b0a35a2cfd37c935c88102741f3fe (patch) | |
tree | c901374ce4e0dd83d6dbf5874729aac8d41b078a /plugins/Monolog/config | |
parent | 2ec7485470701ef5f11521d6bbe62d583e25cddf (diff) |
Make sure Monolog never adds its default handler. (#14239)
Diffstat (limited to 'plugins/Monolog/config')
-rw-r--r-- | plugins/Monolog/config/config.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/Monolog/config/config.php b/plugins/Monolog/config/config.php index b9e9e0c62f..4d5e3d15a3 100644 --- a/plugins/Monolog/config/config.php +++ b/plugins/Monolog/config/config.php @@ -37,7 +37,13 @@ return array( || \Piwik\CliMulti::isCliMultiRequest(); $writerNames = array_map('trim', $writerNames); - $writers = array(); + + $writers = [ + // we always add the null handler to make sure there is at least one handler specified. otherwise Monolog will + // add a stream handler to stderr w/ a DEBUG log level, which will cause archiving requests to fail. + $c->get(\Monolog\Handler\NullHandler::class), + ]; + foreach ($writerNames as $writerName) { if ($writerName === 'screen' && \Piwik\Common::isPhpCliMode()) { continue; // screen writer is only valid for web requests |