When MediaWiki is in "debug profiling" mode (e.g. using XHProf or Tideways, such as at WMF via WikimediaDebug's "Inline profile" option), it will send the collected profile information the configured ProfilerOutput class.
For example:
* ProfilerOutputText append the output as an HTML or JS comment to the HTTP response,
* ProfilerOutputStats flushes each data point to Statsd/Graphite,
* ProfilerOutputDump writes to an `.xhprof` file for viewing purposes in a GUI.
When any of these are enabled via `wgProfiler`, then MediaWiki will also do dump the whole Profiler output to a PSR-3/Monolog debug log channel called `'profileoutput'`. As far as I know, this hasn't been used for many years. It predates our use of Monolog, and quite possibly was already unused even then.
I'm proposing we remove this to simplify the surrounding code and reduce core maintenance for Performance Team. Note that the functionality could be re-implemented in a much cleaner way by any interested third-parties by doing this from their own ProfilerOutput class.
For example:
```lang=php
use MediaWiki\Logger\LoggerFactory;
class ParserOutputPsr3 extends ParserOutput {
public function log( array $stats ) {
$logger = LoggerFactory::getInstance( 'profileoutput' );
$logger->info( "Elapsed: {elapsed}; URL: <{url}>\n{output}", [
'elapsed' => RequestContext::getMain()->getRequest()->getElapsedTime(),
'url' => WebRequest::getGlobalRequestURL(),
'output' => $this->collector->getOutput(),
] );
}
}
# To use:
# $wgProfiler['output'] = [ ParserOutputPsr3::class ];
```