DCausse has uploaded a new change for review.
https://gerrit.wikimedia.org/r/323811
Change subject: Logging: do not use reserved keys in logger context
......................................................................
Logging: do not use reserved keys in logger context
core@includes/debug/logger/monolog/WikiProcessor.php defines
a list of logger context key we should not override.
Rename these to avoid conflicts.
(Extracted with ack-grep
'{(message|channel|level|type|url|ip|http_method|server|referrer|host|wiki|reqId|mwversion|normalized_message)}'
--type php)
Change-Id: I6fa29f06747f5db61c62f03d1ec2ec9a710425a5
---
M includes/ElasticsearchIntermediary.php
M includes/Maintenance/Reindexer.php
2 files changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch
refs/changes/11/323811/1
diff --git a/includes/ElasticsearchIntermediary.php
b/includes/ElasticsearchIntermediary.php
index 5c91c26..e29235f 100644
--- a/includes/ElasticsearchIntermediary.php
+++ b/includes/ElasticsearchIntermediary.php
@@ -199,7 +199,7 @@
$log = $this->finishRequest();
$context = $log->getLogVariables();
list( $status, $message ) =
ElasticaErrorHandler::extractMessageAndStatus( $exception );
- $context['message'] = $message;
+ $context['error_message'] = $message;
$stats =
MediaWikiServices::getInstance()->getStatsdDataFactory();
$type = ElasticaErrorHandler::classifyError( $exception );
@@ -207,7 +207,7 @@
$stats->increment(
"CirrusSearch.$clusterName.backend_failure.$type" );
LoggerFactory::getInstance( 'CirrusSearch' )->warning(
- "Search backend error during {$log->getDescription()}
after {tookMs}: {message}",
+ "Search backend error during {$log->getDescription()}
after {tookMs}: {error_message}",
$context
);
return $status;
diff --git a/includes/Maintenance/Reindexer.php
b/includes/Maintenance/Reindexer.php
index aaa1f09..259d0c9 100644
--- a/includes/Maintenance/Reindexer.php
+++ b/includes/Maintenance/Reindexer.php
@@ -389,9 +389,9 @@
$type = get_class( $e );
$error = ElasticaErrorHandler::extractFullError( $e );
LoggerFactory::getInstance( 'CirrusSearch' )->warning(
- "Search backend error during reindex. Error
type is '{type}' ({error_type}) and message is: {error_reason}",
+ "Search backend error during reindex. Error
type is '{exception_type}' ({error_type}) and message is: {error_reason}",
[
- 'type' => $type,
+ 'exception_type' => $type,
'error_type' => $error['type'],
'error_reason' => $error['reason'],
]
@@ -401,9 +401,9 @@
} catch( \Exception $e ) {
$this->outputIndented( $messagePrefix . "Error during
reindex: " . $e->getMessage() . "\n" );
LoggerFactory::getInstance( 'CirrusSearch' )->warning(
- "Error during reindex: {message}",
+ "Error during reindex: {error_message}",
[
- 'message' => $e->getMessage(),
+ 'error_message' => $e->getMessage(),
'exception' => $e,
]
);
--
To view, visit https://gerrit.wikimedia.org/r/323811
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6fa29f06747f5db61c62f03d1ec2ec9a710425a5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: DCausse <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits