mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
fix(session): Log session ID for debugging
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
7f1b980dcf
commit
826409394a
1 changed files with 7 additions and 0 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Reference in a new issue