diff --git a/developer_manual/basics/logging.rst b/developer_manual/basics/logging.rst index 03b9cd2a9e3..b53d71990cd 100644 --- a/developer_manual/basics/logging.rst +++ b/developer_manual/basics/logging.rst @@ -184,6 +184,42 @@ You can combine message interpolation with exception logging -- Nextcloud handles both. +Keeping secrets out of stack traces +----------------------------------- + +Exception stack traces can include method arguments. Mark parameters that +accept secrets (passwords, tokens, credentials, and similar) with PHP's +standard `#[\SensitiveParameter] `_ +attribute so their values do not end up in the log: + +.. code-block:: php + +