Monolog: our changes to an open source project
The most popular PHP logging library, used by Symfony and Laravel among others.
- Language
- PHP
- GitHub stars
- 21,399
- Project site
- seldaek.github.io/monolog
The change merged into Monolog
RedactingFormatter now also hides secrets nested inside array values under sensitive keys.
- Pull request #2067merged on 9 September 2026
How we tested it
A new test runs a record through PsrLogMessageProcessor and then through RedactingFormatter, and checks that the secret nested in the array does not appear in the output and that [REDACTED] does.
The bug, the fix and the lesson
A summary of our Tech news write-up: what was broken, what we changed and what it means for our own work.
A password inside an array reached the log
RedactingFormatter only collected strings to hide. When the value under password was an array, the processor put it into the message, and the password stayed there in plain text.
Secrets collected at any depth
A new helper, collectSensitiveValue(), walks the value under a sensitive key and collects every string, within the same MAX_DEPTH limit.
Redacting secrets in logs has to walk into nested data.
A key marked sensitive is sensitive even when its value is an array.
Other projects with our changes: PHP
20 projects in this technology have our merged changes. The bar is the repository's stars, next to it the number of our changes. Each row leads to the project's page.
Questions about our changes to Monolog
Where these changes come from, who merged them and whether we can fix something in your library.
Read next
More about this work and the other projects with our changes.
Using Monolog in your project?
If something in it does not work, we fix it at the source and leave a workaround until the release. We reply within an hour.