diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-01-12 00:27:12 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-01-12 00:27:47 +0300 |
commit | b3251b8de08150ce9dd861e7a670c9c8b3cc079d (patch) | |
tree | 4d892a72c4bcaf0e5693e912e615abb1d62dd661 /misc/cron | |
parent | 3434b89beafe2b81402e227df40aeeec0be9a974 (diff) |
Fixes #6978 Empty output for archiving when using the web cron
Diffstat (limited to 'misc/cron')
-rw-r--r-- | misc/cron/archive.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/misc/cron/archive.php b/misc/cron/archive.php index 69c5d1d118..d4dd03eb08 100644 --- a/misc/cron/archive.php +++ b/misc/cron/archive.php @@ -10,6 +10,7 @@ */ use Piwik\Container\StaticContainer; +use Piwik\Log\WebCronArchiveLogger; use Symfony\Bridge\Monolog\Handler\ConsoleHandler; use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Output\OutputInterface; @@ -66,6 +67,9 @@ if (isset($_SERVER['argv']) && Piwik\Console::isSupported()) { /** @var ConsoleHandler $consoleLogHandler */ $consoleLogHandler = StaticContainer::getContainer()->get('Symfony\Bridge\Monolog\Handler\ConsoleHandler'); $consoleLogHandler->setOutput(new ConsoleOutput(OutputInterface::VERBOSITY_VERBOSE)); + } else { + // HTTP request: logs needs to be dumped on stdout + StaticContainer::getContainer()->set('Psr\Log\LoggerInterface', new WebCronArchiveLogger); } $archiver = new Piwik\CronArchive(); |