Page MenuHomePhabricator

Update MWLoggerLegacyLogger for changes to Profiler output
Closed, DeclinedPublic

Description

The profileoutput debug logging channel formatting code needs to be updated to work with the changes that have been made to the Profiler's log data.

Notice: Undefined index: output in /srv/mediawiki/php-master/includes/debug/logger/legacy/Logger.php on line 200
Notice: Undefined index: elapsed in /srv/mediawiki/php-master/includes/debug/logger/legacy/Logger.php on line 197
Notice: Undefined index: anon in /srv/mediawiki/php-master/includes/debug/logger/legacy/Logger.php on line 189
		} elseif ( $channel === 'profileoutput' ) {
			// Legacy wfLogProfilingData formatitng
			$forward = '';
			if ( isset( $context['forwarded_for'] )) {
				$forward = " forwarded for {$context['forwarded_for']}";
			}
			if ( isset( $context['client_ip'] ) ) {
				$forward .= " client IP {$context['client_ip']}";
			}
			if ( isset( $context['from'] ) ) {
				$forward .= " from {$context['from']}";
			}
			if ( $forward ) {
				$forward = "\t(proxied via {$context['proxy']}{$forward})";
			}
			if ( $context['anon'] ) {
				$forward .= ' anon';
			}
			if ( !isset( $context['url'] ) ) {
				$context['url'] = 'n/a';
			}

			$log = sprintf( "%s\t%04.3f\t%s%s\n",
				gmdate( 'YmdHis' ), $context['elapsed'], $context['url'], $forward );

			$text = self::formatAsWfDebugLog(
				$channel, $log . $context['output'], $context );

Event Timeline

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

This is spamming deployment-prep's hhvm.log

This is spamming deployment-prep's hhvm.log

Yeah. The beta cluster is the only place I'm certain that this is being used.

Is this still an issue?

The logging code does not seem to have been changed, but I don't see any hits for "Undefined index" AND Logger.php in logstash-beta. Maybe we turned off the profileoutput log channel though?