docs(dev): overhaul logging chapter for accuracy and completeness#14187
Open
joshtrichards wants to merge 1 commit intomasterfrom
Open
docs(dev): overhaul logging chapter for accuracy and completeness#14187joshtrichards wants to merge 1 commit intomasterfrom
joshtrichards wants to merge 1 commit intomasterfrom
Conversation
…pleteness
The existing logging chapter was minimal, contained a misleading code example, and omitted most of the functionality available to app developers. This rewrite brings the documentation in line with the actual implementation.
Changes:
- Fix basic usage example: remove unused $appName injection, modernize to constructor promotion, explain ScopedPsrLogger auto-scoping
- Add section listing all eight PSR-3 log methods
- Add log level mapping table (PSR-3 to Nextcloud numeric levels)
- Document PSR-3 message interpolation ({placeholder} syntax)
- Document context array special keys (exception, app) and clarify that arbitrary keys are passed through as extra data
- Add dedicated section on exception logging via context['exception']
- Document ILogFactory::getCustomPsrLogger() for custom log files
- Document IDataLogger::logData() for structured data logging
- Document BeforeMessageLoggedEvent for listening to log writes
- Document obfuscateParameters on CriticalActionPerformedEvent
Signed-off-by: Josh <josh.t.richards@gmail.com>
susnux
approved these changes
Apr 2, 2026
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.
☑️ Resolves
The previous logging documentation was minimal, contained outdated examples, and omitted significant functionality. This rewrite brings the chapter in line with the current implementation (on the dev-side).
Changes
$appNameinjection, and explainedScopedPsrLoggerauto-scoping.{placeholder}syntax), and added a PSR-3 to Nextcloud numeric level mapping table.contextarray special keys (exception,app) and added a dedicated section on logging exceptions viacontext['exception'].ILogFactory::getCustomPsrLogger()for custom files andIDataLogger::logData()for structured data.BeforeMessageLoggedEventfor listening to log writes andobfuscateParametersforCriticalActionPerformedEvent.🖼️ Screenshots