mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-04 18:58:37 +00:00
Merge "Try using structured logging again"
This commit is contained in:
commit
182b9c78ad
|
@ -134,13 +134,15 @@ class ApiVisualEditor extends ApiBase {
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// error null, code not 200
|
// error null, code not 200
|
||||||
$trace = ( new Exception )->getTraceAsString();
|
|
||||||
$this->logger->warning(
|
$this->logger->warning(
|
||||||
__METHOD__ . ": Received HTTP {$response['code']} from RESTBase for $path." .
|
__METHOD__ . ": Received HTTP {code} from RESTBase",
|
||||||
" Trace: {$trace}" .
|
[
|
||||||
" Response: {$response['body']}" .
|
'code' => $response['code'],
|
||||||
/** @phan-suppress-next-line PhanTypeInvalidDimOffset */
|
'trace' => ( new Exception )->getTraceAsString(),
|
||||||
" Request If-Match: {$reqheaders['If-Match']}"
|
'response' => $response['body'],
|
||||||
|
'requestPath' => $path,
|
||||||
|
'requestIfMatch' => $reqheaders['If-Match'] ?? '',
|
||||||
|
]
|
||||||
);
|
);
|
||||||
$this->dieWithError(
|
$this->dieWithError(
|
||||||
[ 'apierror-visualeditor-docserver-http', $response['code'] ],
|
[ 'apierror-visualeditor-docserver-http', $response['code'] ],
|
||||||
|
@ -634,7 +636,11 @@ class ApiVisualEditor extends ApiBase {
|
||||||
$badetag = $params['badetag'];
|
$badetag = $params['badetag'];
|
||||||
$goodetag = $result['etag'] ?? '';
|
$goodetag = $result['etag'] ?? '';
|
||||||
$this->logger->info(
|
$this->logger->info(
|
||||||
__METHOD__ . ": Client reported bad ETag: $badetag, expected: $goodetag"
|
__METHOD__ . ": Client reported bad ETag: {badetag}, expected: {goodetag}",
|
||||||
|
[
|
||||||
|
'badetag' => $badetag,
|
||||||
|
'goodetag' => $goodetag,
|
||||||
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ( $params['paction'] === 'parse' ||
|
if ( $params['paction'] === 'parse' ||
|
||||||
|
|
|
@ -288,7 +288,11 @@ class ApiVisualEditorEdit extends ApiVisualEditor {
|
||||||
"?$
|
"?$
|
||||||
/x', $etag ) ) {
|
/x', $etag ) ) {
|
||||||
$this->logger->info(
|
$this->logger->info(
|
||||||
__METHOD__ . ": Received funny ETag from client: $etag for $path"
|
__METHOD__ . ": Received funny ETag from client: {etag}",
|
||||||
|
[
|
||||||
|
'etag' => $etag,
|
||||||
|
'requestPath' => $path,
|
||||||
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return $this->requestRestbase(
|
return $this->requestRestbase(
|
||||||
|
|
Loading…
Reference in a new issue