aboutsummaryrefslogtreecommitdiffstats
path: root/includes/libs/filebackend/SwiftFileBackend.php
diff options
context:
space:
mode:
authorTimo Tijhof <krinkle@fastmail.com>2025-01-03 20:53:48 +0000
committerTimo Tijhof <krinkle@fastmail.com>2025-01-07 20:11:50 +0000
commit93fbcde934a7bfc77a328095db31b673f6a6114e (patch)
tree7ef248b7e8afb1aa5446e0daf67bd16dddc702ea /includes/libs/filebackend/SwiftFileBackend.php
parenta97f9bcbe894011d6bc8fd90990512ac499a5b9d (diff)
downloadmediawikicore-93fbcde934a7bfc77a328095db31b673f6a6114e.tar.gz
mediawikicore-93fbcde934a7bfc77a328095db31b673f6a6114e.zip
filebackend: Improve debug messages by passing native context or CSV
By passing arrays as native PSR3 context, the values end up as part of the structured debug logs in Logstash where they can be shown on-screen, selected, and copied into bug reports as their original values instead of with JSON-escaping for various characters. This is not a big deal today since FormatJson defaults to JSON_UNESCAPED_SLASHES (which is important because most of these values contain file paths that definitely include slashes). But, this will change as part of T382910 by removing use FormatJson, and inlining these gets tedious so instead pass it as native data where the data is non-trivial, and for others embed the paths within the string unchanged comma-separated. Bug: T382910 Change-Id: I79fba128a8129b9ac4da17b513b5da0b03d90bf9
Diffstat (limited to 'includes/libs/filebackend/SwiftFileBackend.php')
-rw-r--r--includes/libs/filebackend/SwiftFileBackend.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/includes/libs/filebackend/SwiftFileBackend.php b/includes/libs/filebackend/SwiftFileBackend.php
index c9dee0ccd554..fdeba2b3720b 100644
--- a/includes/libs/filebackend/SwiftFileBackend.php
+++ b/includes/libs/filebackend/SwiftFileBackend.php
@@ -2020,12 +2020,12 @@ class SwiftFileBackend extends FileBackendStore {
if ( $status instanceof StatusValue ) {
$status->fatal( 'backend-fail-internal', $this->name );
}
- $msg = "HTTP {code} ({desc}) in '{func}' (given '{req_params}')";
+ $msg = "HTTP {code} ({desc}) in '{func}'";
$msgParams = [
'code' => $code,
'desc' => $desc,
'func' => $func,
- 'req_params' => FormatJson::encode( $params ),
+ 'req_params' => $params,
];
if ( $err ) {
$msg .= ': {err}';