Page MenuHomePhabricator

Debug toolbar does not show queries or debug log if $wgMWLoggerDefaultSpi is set
Closed, DuplicatePublic

Description

Here is my development environment config, but the debug toolbar is not showing any queries or the debug log. Commenting out $wgMWLoggerDefaultSpi makes them show up.

$wgMWLoggerDefaultSpi = [
	'class' => MediaWiki\Logger\MonologSpi::class,
	'args' => [ [
		'loggers' => [
			'@default' => [
				'processors' => [ 'psr' ],
				'handlers' => [ 'default' ],
			],
			'error' => [
				'processors' => [ 'psr' ],
				'handlers' => [ 'mediawiki-error' ]
			],
			'exception' => [
				'processors' => [ 'psr' ],
				'handlers' => [ 'mediawiki-error' ]
			],
			'fatal' => [
				'processors' => [ 'psr' ],
				'handlers' => [ 'mediawiki-error' ]
			],
			'DeferredUpdates' => [
				'processors' => [ 'psr' ],
				'handlers' => [ 'mediawiki-error' ]
			],
			'translation-exports' => [
				'processors' => [ 'psr' ],
				'handlers' => [ 'mediawiki' ]
			],
			'Translate.Jobs' => [
				'processors' => [ 'psr' ],
				'handlers' => [ 'mediawiki' ]
			],
			'TranslationNotifications.Jobs' => [
				'processors' => [ 'psr' ],
				'handlers' => [ 'mediawiki' ]
			],
		],
		'processors' => [
			'psr' => [ 'class' => Monolog\Processor\PsrLogMessageProcessor::class ],
		],
		'handlers' => [
			'mediawiki-error' => [
				'class' => Monolog\Handler\StreamHandler::class,
				'args' => [ "$LOGS/mediawiki-error" ],
				'formatter' => 'line-stack'
			],
			'mediawiki' => [
				'class' => Monolog\Handler\StreamHandler::class,
				'args' => [ "$LOGS/mediawiki" ],
				'formatter' => 'line'
			],
			'default' => [
				'class' => Monolog\Handler\StreamHandler::class,
				'args' => [ "$LOGS/default" ],
				'formatter' => 'line'
			],
			'blackhole' => [
				'class' => Monolog\Handler\NullHandler::class,
			],
		],
		'formatters' => [
			'line' => [
				'class' => Monolog\Formatter\LineFormatter::class
			],
			'line-stack' => [
				'class' => Monolog\Formatter\LineFormatter::class,
				'calls' => [ 'includeStacktraces' => [ true ] ]
			],
		]
	] ]
];