Page MenuHomePhabricator

Add support for MWDebug and $wgDebugToolbar to MonologSpi
Closed, DuplicatePublic

Description

$wgMWLoggerDefaultSpi controls which Spi service class is responsible for handling ::getLogger calls in MediaWiki and thus controls how and where error log and diagnostic debug messages are sent.

The default Spi ("LegacySpi") has support for MWDebug, which means that if you enable $wgDebugToolbar in your development environment, all debug messages are shown on-screen for easy access.

For people that use a non-default $wgMWLoggerDefaultSpi configuration in their development enviornment, such the MonologSpi (which WMF uses in production), there are currently no debug messages shown in the Debug toolbar feature. This is because MonologSpi is missing MWDebug intergration.

This was raised by @matmarex in change 962753.

Event Timeline

I think the nicer approach would be to use a wrapper (maybe LogCapturingSpi) when $wgDebugToolbar is true.

This seems to be a duplicate of T114532, and there is Gerrit patch waiting for review :)