Skip to content

feat(log): add opt-in session ID logging #53506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChristophWurst
Copy link
Member

@ChristophWurst ChristophWurst commented Jun 16, 2025

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

  • Do

Checklist

@ChristophWurst
Copy link
Member Author

/backport to stable31

@ChristophWurst
Copy link
Member Author

/backport to stable30

@@ -170,6 +172,13 @@ public function log(int $level, string $message, array $context = []): void {
if (!$hasBacktrace && $logBacktrace) {
$entry['backtrace'] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
}
if ($this->config->getValue('log.sessionId', false)) {
try {
$entry['sessionId'] = \OCP\Server::get(ISession::class)->getId();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No DI possible here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants