diff --git a/lib/private/Log/LogDetails.php b/lib/private/Log/LogDetails.php index 043039b23db..8c1efaea20d 100644 --- a/lib/private/Log/LogDetails.php +++ b/lib/private/Log/LogDetails.php @@ -46,10 +46,8 @@ abstract class LogDetails { $userAgent = '--'; } $version = $this->config->getValue('version', ''); - $clientReqId = $request->getHeader('X-Request-Id'); $entry = compact( 'reqId', - 'clientReqId', 'level', 'time', 'remoteAddr', @@ -61,6 +59,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