Skip to content

Document LoggedQuery::setRedactor()#8291

Draft
dereuromark wants to merge 1 commit into5.nextfrom
feature/logged-query-redactor
Draft

Document LoggedQuery::setRedactor()#8291
dereuromark wants to merge 1 commit into5.nextfrom
feature/logged-query-redactor

Conversation

@dereuromark
Copy link
Copy Markdown
Member

Documents Cake\Database\Log\LoggedQuery::setRedactor() introduced in cakephp/cakephp#19419.

Where the docs live

  • New subsection "Redacting Sensitive Values from Query Logs" under the existing Query Logging section in docs/en/orm/database-basics.md. Covers:
    • Why the hook exists (bound secrets get spliced into rendered SQL via LoggedQuery::__toString / getContext / jsonSerialize).
    • How to register a redactor closure.
    • The three exit points it applies to.
    • Silent-fallback behaviour for redactors that throw or return malformed values.
  • One-line entry in docs/en/appendices/5-4-migration-guide.md under the existing Database new-features list, linking back to the new subsection.

Pairs with

Filed as draft until the implementation PR merges and a target release is tagged. Will flip to "Ready for review" then.

Adds a "Redacting Sensitive Values from Query Logs" subsection under
the existing Query Logging section in `orm/database-basics.md` and a
matching entry in the 5.4 migration guide's Database changes.

Covers what the hook is for (any secret bound as a parameter ends up
in every surface that consumes a LoggedQuery), how to register one,
which exit points it covers (`interpolate()`, `getContext()`,
`jsonSerialize()`), and the silent-fallback behaviour for redactors
that throw or return a malformed value.
@dereuromark dereuromark added this to the 5.next milestone May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant