@mgazdzik opened this Issue on March 11th 2015 Contributor

I think it would be useful on some ocassions to have ability of selective debug in tracker.
Basically it could be additional parameter, saying "display tracker debug only when &debug present" (preety much alike https://github.com/piwik/piwik/blob/1.12/config/global.ini.php#L491 - not sure when it was removed). Without parameter, tracker wouldn't produce any debug output.

It would allow to debug tracker behaviour without affecting most requests - especially when we want to debug tracker issue on production server with high traffic. Enabling debug for all requests could drastically decrease tracker performance, but couple of manually launched requests with additional param wouldn't cause problems.

@diosmosis commented on March 11th 2015 Member

I think this could lead to abuse, ie an attacker could just spam a machine w/ &debug=1 to cause problems. Maybe it could only be allowed if a INI config setting is set?

@mattab commented on March 11th 2015 Owner

correct, the main reason we can't allow this is the abuse / security risks of logging output to screen. Instead, maybe we could let Super Users configure the Logging in the UI. A bit like this plugin: http://plugins.piwik.org/kDebug but maybe part of core. Maybe also related to viewing the logs in the Admin UI #7239

@mgazdzik commented on March 12th 2015 Contributor

My point was to enable this param only when tracker debug is enabled as well (like this parameter for API calls https://github.com/piwik/piwik/blob/1.12/config/global.ini.php#L491). It would allow printing debug/log info only when param is passed. Also I agree that it should work only when debug is enabled.

Point was to make tracker debug possible on high traffic prod instances. Currently we can log only all requests output from tracker to screen/file which virtually makes this debug unusable with 150-200 req/s.

Does it make this idea more feasible ?

@mattab commented on March 12th 2015 Owner

You mean something like this?

[Tracker]
debug=1
debug_log_only_when_debug_parameter_in_request=1

when debug_log_only_when_debug_parameter_in_request=1 then user needs to set &debug=1 in the HTTP request to see the debug info (on screen or in file according to how the logger is configured). Is it what you meant?

@mgazdzik commented on March 12th 2015 Contributor

yes, exactly :) this will allow to display/log output only for particular requests during debug time window and will not affect any requests other than ones we really want to debug.

@mnapoli commented on March 25th 2015 Member

PR: #7537

This Issue was closed on March 26th 2015
Powered by GitHub Issue Mirror