Repository navigation
feat(admin_audit): log structured parameters with audit entries - #65310
Open
GhassenKefi wants to merge 3 commits into
Open
GhassenKefi wants to merge 3 commits into
GhassenKefi wants to merge 3 commits into
Conversation
GhassenKefi
requested review from
CarlSchwan,
leftybournes,
provokateurin,
salmart-dev,
sorbaugh and
susnux
and removed request for
a team
October 8, 2026 10:27
ILogFactory::getCustomPsrLogger() gets an optional $structuredContext flag. When set, array values of the log context are written as nested data in the log entry instead of being encoded to a JSON string, so consumers can read them as fields. Values used as message placeholders are still converted to strings, and loggers without the flag, including nextcloud.log, are unchanged. Message interpolation now only replaces placeholders that occur in the message, so array values that are not placeholders are never cast to strings. Refs nextcloud-gmbh/governance#198 Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Audit entries now carry the parameters they are built from as a nested "params" object in their data (e.g. data.params.shareWith), so log consumers no longer need to parse the human-readable message. Numbers and booleans keep their type. Parameters are left out when the call asks for obfuscation. The audit logger requests a custom logger with structured context, so only audit.log is affected. Refs nextcloud-gmbh/governance#198 Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Log entries only recorded the user ID, which is hard to read in exports and can't be matched once an account is renamed or deleted. Entries now also contain "userDisplayName" next to "user" when a user is logged in and the name can be resolved. The name comes from IUserManager::getDisplayName(), which is cached. A guard prevents recursion when the lookup itself writes a log entry, and lookup failures leave the field out instead of breaking logging. Refs nextcloud-gmbh/governance#198 Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
GhassenKefi
force-pushed
the
feat/admin-audit-structured-params
branch
from
October 13, 2026 12:46
736654d to
371e5f1
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)