@floSoX opened this Issue on April 10th 2019

Matomo Version: 3.9.1
PHP Version: tested with 7.0.33 and 7.3.3
Middleware: Apache 2.4
OS : Debian

I followed the instructions of https://matomo.org/faq/troubleshooting/faq_115/ to enable log in Matomo.
So I added:

log_writers[] = file
log_level = DEBUG

in my config/config.ini.php

I checked if the Monolog Plugin was enabled and it was.

But no log file is created.

I try to add

logger_file_path = /var/www/html/tmp/logs/matomo.log

but same result.

I also try to log in database but nothing still visible in LogViewer plugin.

Could you please tell me if I miss something?

Thank you in advance.

@tsteur commented on April 10th 2019 Member

It's only created when something is actually logged. We're actually not too big on logging and usually only logging when something goes wrong.

Maybe put a line like \Piwik\Log::info('foo bar'); into core/FrontController.php in the dispatch method around line 150. Maybe something appears then?

@floSoX commented on April 11th 2019

Thank you @tsteur for you answer.

I followed your instructions and I navigated on the UI but unfortunately without result
I don't have any log.

@Findus23 commented on April 11th 2019 Member

I am not entirely sure if this isn't a bug in Matomo.
I am just setting up a new Matomo instance and no matomo.log file is created.

Maybe this is a regression from one of the recent logging changes

@tsteur commented on April 11th 2019 Member

I can reproduce it when the screen writer is not enabled. If the screen writer is enabled too, then it works.

@tsteur commented on April 11th 2019 Member

Actually I can't reproduce it. I had a mistake in the config file. Tested various cases with and without instanceId etc.

Maybe only happens with some specific PHP version or so. The file that does it is vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php and plugins/Monolog/Handler/FileHandler.php.

I doubt we can do much on our side here. If someone could debug this, that would be great. We may have a look if someone can provide access to a server and Matomo where this can be reproduced. Make otherwise sure the config section isn't defined twice etc.

@Findus23 commented on April 12th 2019 Member

This should be fixed with #14296 (and therefore the next Matomo release)

For me manually applying https://patch-diff.githubusercontent.com/raw/matomo-org/matomo/pull/14296.patch does fix the issue (you can ignore the change in tests/PHPUnit/Fixtures/UITestFixture.php)

(thanks to @diosmosis for the tip)

@gpanagiotidis commented on May 16th 2019


I still have this issue with Matomo v3.9.1. PHP version I am using is php 7.2 by red had software collections.

I am going to try to apply the patch manually.

@gpanagiotidis commented on May 22nd 2019

The patch actually solves the problem. Should be applied in next Matomo version.

This Issue was closed on April 12th 2019
Powered by GitHub Issue Mirror