aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2024-01-23 14:00:16 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2024-01-23 14:00:16 +0100
commit826409394ae6fcb33ea3f619a9824570351e23ab (patch)
tree7f9592f134bc615fdd8f9d6de84910a356be43db
parent7f1b980dcfd55ef9e277865cebd6879f69e3e43a (diff)
downloadnextcloud-server-fix/session/log-session-id.tar.gz
nextcloud-server-fix/session/log-session-id.zip
fix(session): Log session ID for debuggingfix/session/log-session-id
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
-rw-r--r--lib/private/Log/LogDetails.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/private/Log/LogDetails.php b/lib/private/Log/LogDetails.php
index ec88aa767fb..ad680f98fe7 100644
--- a/lib/private/Log/LogDetails.php
+++ b/lib/private/Log/LogDetails.php
@@ -26,6 +26,7 @@
namespace OC\Log;
use OC\SystemConfig;
+use Throwable;
abstract class LogDetails {
public function __construct(
@@ -51,6 +52,11 @@ abstract class LogDetails {
}
$request = \OC::$server->getRequest();
$reqId = $request->getId();
+ $sessionId = '--';
+ try {
+ $session = \OC::$server->getSession();
+ $sessionId = $session->getId();
+ } catch (Throwable $e) {}
$remoteAddr = $request->getRemoteAddress();
// remove username/passwords from URLs before writing the to the log file
$time = $time->format($format);
@@ -68,6 +74,7 @@ abstract class LogDetails {
$version = $this->config->getValue('version', '');
$entry = compact(
'reqId',
+ 'sessionId',
'level',
'time',
'remoteAddr',