Changesets that could still use your attention: * Add a PSR-3 based logging interface https://gerrit.wikimedia.org/r/#/c/119940/ * Enable MWLogger logging for wfLogProfilingData https://gerrit.wikimedia.org/r/#/c/119942/
Sumana Harihareswara Senior Technical Writer Wikimedia Foundation
On Fri, Apr 11, 2014 at 11:38 AM, Bryan Davis bd808@wikimedia.org wrote:
On Fri, Mar 14, 2014 at 4:07 PM, Bryan Davis bd808@wikimedia.org wrote:
The structured logging RFC [0] will be up for discussion again next Wednesday [1]. There is a strawman implementation in gerrit [2] that is likely to be the focus of discussion unless there are other issues that the reviewers find more pressing.
At this point the most controversial aspect of my proposed implementation seems to be importing third-party libraries into mw-core and/or the use of composer to manage that activity. I would welcome discussion of alternatives or consensus that this is a reasonable approach for the immediate future that should be revisited if and when a better idea is found for the general problem.
[0]:
https://www.mediawiki.org/wiki/Requests_for_comment/Structured_logging
[1]:
https://www.mediawiki.org/wiki/Architecture_meetings/RFC_review_2014-03-19
The outcome of the discussion on this was approval by Tim of the general concept of using Composer to manage importing libraries into MediaWiki-Core. I took that as incentive to split the monolithic proof-of-concept patch into four smaller logical for review and approval:
- Gerrit change 119939 Add Composer managed libraries [3]
Import Psr\Log and Monolog libraries to MW-Core in a new "libs" directory which is managed using Composer. The includes/AutoLoader.php script has been modified to require the lib/autoload.php class autoloader script generated by Composer.
- Gerrit change 119940 Add a PSR-3 based logging interface [4]
The MWLogger class is actually a thin wrapper around any PSR-3 LoggerInterface implementation. Named MWLogger instances can be obtained from the MWLogger::getInstance() static method. MWLogger expects a class implementing the MWLoggerSpi interface to act as a factory for new MWLogger instances. A concrete MWLoggerSpi implementation using the Monolog library is also provided.
- Gerrit change 119941 Enable MWLogger logging for legacy logging methods
[5]
Introduces the $wgUseMWLoggerForLegacyFunctions that enables the use of the MWLogger PSR-3 logger for legacy global logging functions. When enabled wfDebug, wfDebugLog and wfLogDBError will route their log messages to MWLogger instances.
- Gerrit change 119942 Enable MWLogger logging for wfLogProfilingData [6]
Output structured profiling report data from wfLogProfilingData when $wgUseMWLoggerForLegacyFunctions is enabled.
I got some great review feedback from Jeroen on the first patch [3]. We were able to iterate to get to a point where he was satisfied with the technical implementation of the composer.json and gave it a +1. The second patch [4] got some comments from Tyler and Timo which I have tried to respond to. Tyler caught a small formatting problem in the third patch [5] that has been corrected. I have gotten no feedback at all on the final patch [6].
I'd really like to see this work merged so that I can continue to build on it to improve the error and debug logging capabilities of MediaWiki. The net result if this was all merged today would be some classes that could be used if a deployment modified it's LocalSettings.php configuration to enable them. Nothing should break anywhere in the default case. I know that most people don't find logging to be sexy stuff to think about and that I'm weird for being obsessed with this sort of thing. I'm looking for advice from the people on this mailing list on how to find someone to work with me to finish the review of at least the first 3 patches and give +2 to get this initiative moving again.
Bryan
Bryan Davis Wikimedia Foundation bd808@wikimedia.org [[m:User:BDavis_(WMF)]] Sr Software Engineer Boise, ID USA irc: bd808 v:415.839.6885 x6855
wikitech-l@lists.wikimedia.org