Repository navigation
feat(log): add opt-in session ID logging - #53506
ChristophWurst wants to merge 1 commit into
Conversation
|
/backport to stable31 |
|
/backport to stable30 |
| } | ||
| if ($this->config->getValue('log.sessionId', false)) { | ||
| try { | ||
| $entry['sessionId'] = \OCP\Server::get(ISession::class)->getId(); |
There was a problem hiding this comment.
Not sure it can be done safely nor is worth the risk at the moment. Since Log is a core service and this path is opt-in, lookup seems lower risk than DI here. Doing the session ID lookup in a protected helper method might be a good idea though for testability.
There was a problem hiding this comment.
My main concern is that this logs the raw session ID, which is fairly sensitive. Could we either:
-
document very explicitly that
log.sessionIdis for temporary debugging only and logs sensitive identifiers, or -
log a derived value instead (e.g. hashed session ID) if correlation is all we need?
There was a problem hiding this comment.
| 'debug.sessionId' => false, |
Maybe to make debugging purposes only even more explicit. ;)
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at> Assisted-by: ClaudeCode:claude-opus-5-5
c9b316b to
acbebed
Compare
susnux
left a comment
There was a problem hiding this comment.
rebased but this needs adjustment to follow naming policies!
| * | ||
| * Defaults to ``false``. | ||
| */ | ||
| 'log.sessionId' => false, |
There was a problem hiding this comment.
| 'log.sessionId' => false, | |
| 'log_debug_sessionId' => false, |
Summary
Optionally allow admins to enable logging of session IDs. This allows to see when a new session is started for a user. That information is not trackable right now.
TODO
Checklist