Creating useful log files is a key part of building a useful, scalable and easy to manage software product. At Piwik recently we improved our logging backend, re-using monolog, and we've improve logging messages regularly in last releases.
To enable logging we point users to this FAQ: I’m a developer, how do I enable logging (and / or SQL profiling) in Piwik?. Currently, it is possible to debug the tracker by outputting results to the HTTP output (see this help).
The goal of this issue is to also provide a way for users to enable logging during Piwik Tracker (piwik.php API endpoint).
printDebugfunction to reuse the monolog logger: https://github.com/piwik/piwik/blob/master/core/Common.php#L1260-1266
Targetting for 2.15.0 as IMO we need good logging capabilities in Tracker in LTS.
- check FAQ is up to date: https://piwik.org/faq/troubleshooting/faq_115/
Looks up to date
- add a note in http://developer.piwik.org/api-reference/tracking-api#debugging-the-tracker about how to enable logging for all tracker requests (with a link to previous faq)
I do not really understand what is meant by all tracker requests. Once tracker debug is enabled the requests will be logged as described on that page
check FAQ is up to date: https://piwik.org/faq/troubleshooting/faq_115/
In http://developer.piwik.org/api-reference/tracking-api#debugging-the-tracker there should be a note about the
[Tracker] debug_on_demand option.
Not sure if we should actually mention
debug_on_demand it as it is potentially a security risk when people forget to turn it off again. I added a note about that recently in
global.ini.php. Was discussing with @mattab recently and we were thinking about displaying a notification in the UI as long as it is enabled. It can be mentioned but we definitely need to mention the security risk and maybe even display a notification while it is enabled.
Notification sounds good. The option is very useful in some situations, eg, when troubleshooting production instances or apps that use the tracker API (eg, the log importer). Perhaps a IP whitelist or host whitelist can be used as well to make sure no one else sees the debug output.
We should also perhaps not log token auths (or at least whole ones) in tracker debug output.
debug_on_demand to developer docs
Very nice & useful!