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

Infinite loop when using the DatabaseHandler logger with DEBUG level #7017

Closed
jon48 opened this issue Jan 14, 2015 · 2 comments
Closed

Infinite loop when using the DatabaseHandler logger with DEBUG level #7017

jon48 opened this issue Jan 14, 2015 · 2 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@jon48
Copy link

jon48 commented Jan 14, 2015

Hello,

Configure your logging setting to the below:

[log]
log_writers[] = "database"
log_level = "DEBUG"

When trying to access Piwik front-end you will get a fatal error:
Fatal error: Maximum function nesting level of '100' reached, aborting! in [...]\piwik\vendor\monolog\monolog\src\Monolog\Logger.php on line 441

This seems to be due to the SQL statements being automatically logged at DEBUG level: when the logger of type DatabaseHandler uses its write method, it calls the standard Db::query method which itself will try to log the log insertion statement, hence calling again the logging method and triggering an infinite loop.

Not sure what the best way to fix it (implementing a specific non-logged query method in the Db class, adding an extra parameter in the existing methods to prevent logging, putting in place a switch to stop/start logging..)?

Regards.
Jonathan

@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Jan 14, 2015
@mattab mattab added this to the Piwik 2.11.0 milestone Jan 14, 2015
@mattab
Copy link
Member

mattab commented Jan 14, 2015

Thanks @jon48 for the report. maybe @mnapoli you have an idea about that one?

@mnapoli mnapoli self-assigned this Jan 14, 2015
@mnapoli
Copy link
Contributor

mnapoli commented Jan 14, 2015

Hi @jon48 thanks for reporting it, I've implemented a fix to disable query logging when inside the database log handler.

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

3 participants