From 9d28c94a816f06f3390f4fd3e32580b943357233 Mon Sep 17 00:00:00 2001 From: Paul Water Date: Thu, 7 Jul 2022 12:01:30 +0200 Subject: [PATCH] User ID might not be derivable. --- src/RequestLoggerLight.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/RequestLoggerLight.php b/src/RequestLoggerLight.php index d53f347..c2ba19d 100644 --- a/src/RequestLoggerLight.php +++ b/src/RequestLoggerLight.php @@ -43,6 +43,7 @@ class RequestLoggerLight extends PlaisioObject implements RequestLogger public ?int $rqlId = null; //-------------------------------------------------------------------------------------------------------------------- + /** * Logs the HTTP page request. * @@ -65,17 +66,26 @@ public function logRequest(?int $status): void try { - $cmp = $this->nub->company->cmpId; + $cmpId = $this->nub->company->cmpId; + } + catch (\Throwable $e) + { + $cmpId = null; + } + + try + { + $usrId = $this->nub->session->usrId; } catch (\Throwable $e) { - $cmp = null; + $usrId = null; } $this->rqlId = $this->nub->DL->abcRequestLoggerLightInsertRequest( $this->nub->session->sesId, - $cmp, - $this->nub->session->usrId, + $cmpId, + $usrId, $this->nub->requestHandler->getPagId(), mb_substr($this->nub->request->getRequestUri() ?? '', 0, C::LEN_RQL_REQUEST), mb_substr($this->nub->request->getMethod() ?? '', 0, C::LEN_RQL_METHOD),