Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to activate the log #14334

Closed
FlorentPoinsaut opened this issue Apr 10, 2019 · 8 comments
Closed

Unable to activate the log #14334

FlorentPoinsaut opened this issue Apr 10, 2019 · 8 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@FlorentPoinsaut
Copy link

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]
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.
Regards,

@tsteur
Copy link
Member

tsteur commented Apr 10, 2019

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?

@FlorentPoinsaut
Copy link
Author

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
Copy link
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
Copy link
Member

tsteur commented Apr 11, 2019

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

@tsteur tsteur added Bug For errors / faults / flaws / inconsistencies etc. Regression Indicates a feature used to work in a certain way but it no longer does even though it should. labels Apr 11, 2019
@tsteur tsteur added this to the 3.10.0 milestone Apr 11, 2019
@tsteur
Copy link
Member

tsteur commented Apr 11, 2019

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.

@tsteur tsteur added Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. and removed Bug For errors / faults / flaws / inconsistencies etc. Regression Indicates a feature used to work in a certain way but it no longer does even though it should. labels Apr 11, 2019
@tsteur tsteur modified the milestones: 3.10.0, Backlog (Help wanted) Apr 12, 2019
@Findus23
Copy link
Member

Findus23 commented Apr 12, 2019

@floSoX
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)

@Findus23 Findus23 added Bug For errors / faults / flaws / inconsistencies etc. and removed Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. labels Apr 12, 2019
@gpanagiotidis
Copy link

@Findus23

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

4 participants