mirror of
https://github.com/nextcloud/server.git
synced 2026-03-02 05:20:46 -05:00
fix(log): Only log client request id if present, and at the end
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
da451d9d3c
commit
d1ca8a67d6
1 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue