aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2025-05-13 11:18:20 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2025-05-14 08:07:46 +0000
commit01e2e3076702cd0a2b1dfa35f9a6fa97e4af1d37 (patch)
tree86a87a8c8d03a724cfc32ee46fbc109cc995caa1
parentacf03a2389a669ae33b9b09d1ac4587146f622da (diff)
downloadnextcloud-server-backport/52782/stable30.tar.gz
nextcloud-server-backport/52782/stable30.zip
fix(log): Only log client request id if present, and at the endbackport/52782/stable30
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r--lib/private/Log/LogDetails.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/Log/LogDetails.php b/lib/private/Log/LogDetails.php
index 7406385fd58..982c1b23ac6 100644
--- a/lib/private/Log/LogDetails.php
+++ b/lib/private/Log/LogDetails.php
@@ -47,10 +47,8 @@ abstract class LogDetails {
$userAgent = '--';
}
$version = $this->config->getValue('version', '');
- $clientReqId = $request->getHeader('X-Request-Id');
$entry = compact(
'reqId',
- 'clientReqId',
'level',
'time',
'remoteAddr',
@@ -62,6 +60,10 @@ abstract class LogDetails {
'userAgent',
'version'
);
+ $clientReqId = $request->getHeader('X-Request-Id');
+ if ($clientReqId !== '') {
+ $entry['clientReqId'] = $clientReqId;
+ }
if (is_array($message)) {
// Exception messages are extracted and the exception is put into a separate field