Page MenuHomePhabricator

Integrate a modern debug/error display tool into MediaWiki
Open, Needs TriagePublic

Description

The MediaWiki ecosystem has some highly sophisticated loggin/debugging/error reporting tools such as the ELK stack, but they are nontrivial to set up and an effort to use (you need to go to the aggregation site and search for your error or log message, instead of just having it right on the wiki page where the error happened). It would be nice to integrate some modern error display / debug tool into MediaWiki for casual development - probably as an extension, since such tools tend to be insecure. A few possibilities:

Event Timeline

Tgr raised the priority of this task from to Needs Triage.
Tgr updated the task description. (Show Details)
Tgr added a subscriber: Tgr.

The debug toolbar should emit all log messages to the current page, and it also works with API requests. Did you have something else in mind?

Errors, specifically, not normal logs. Error logger tools tend to have some nice features:

  • show code context for the stack trace
  • show detailed information about the parameters in the stack trace, with some GUI to manage the huge amount of information
  • IDE integration so that you can click on the stack trace and open the location in your editor

Also, they don't require you to enable the debug toolbar and then reproduce the error.

This proposal is selected for the Developer-Wishlist voting round and will be added to a MediaWiki page very soon. To the subscribers, or proposer of this task: please help modify the task description: add a brief summary (10-12 lines) of the problem that this proposal raises, topics discussed in the comments, and a proposed solution (if there is any yet). Remember to add a header with a title "Description," to your content. Please do so before February 5th, 12:00 pm UTC.

This was the fifth most popular item in the Developer Wishlist results. I might work on this (but won't fight if anyone else wants to).

Seems fairly simple: find a way to allow extensions to replace MWExceptionRenderer (hook? MediaWikiServices::redefineService? the first is ugly, the second seems a bit scary), define an interface for replacements, write an extension which uses whoops to display the error (in the wiki content area if OutputPage can be used, on the full page otherwise).

Change 355033 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/vagrant@master] Add whoops role

https://gerrit.wikimedia.org/r/355033

Change 355061 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/core@master] Turn MWExceptionRenderer into a service

https://gerrit.wikimedia.org/r/355061

Change 355062 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/extensions/Whoops@master] Create extension files

https://gerrit.wikimedia.org/r/355062

Change 355063 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[integration/config@master] Set up CI for Whoops extension

https://gerrit.wikimedia.org/r/355063

Change 355063 merged by jenkins-bot:
[integration/config@master] Set up CI for Whoops extension

https://gerrit.wikimedia.org/r/355063

Change 355033 merged by jenkins-bot:
[mediawiki/vagrant@master] Add whoops role

https://gerrit.wikimedia.org/r/355033

See Whoops and https://gerrit.wikimedia.org/r/#/c/355062/. Needs some more work, I'm pretty confident I'll get it done by the end of the year.

FirePHP is a logger, not an error renderer. IIRC there's a Monolog handler for it so MediaWiki can already be configured to use it.