[GH-ISSUE #1780] How Remove PII (Personal Information) from MonoLog log files? #749

Closed
opened 2026-03-04 02:17:38 +03:00 by kerem · 1 comment
Owner

Originally created by @ballcorn on GitHub (Dec 3, 2022).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/1780

Monolog version 3?

I see some plugins and scripts to remove PII from monolog logs, but everything i have found is realted to Monolog 2. How can i remove information like CreditCard data from any logs?

Here's and example i found for Monolog 2.0

If I implement what is here with Monolog 3, I get the following error.

Fatal error: Declaration of RedactSensitive\RedactSensitiveProcessor::__invoke(array $record): array must be compatible with Monolog\Processor\ProcessorInterface::__invoke(Monolog\LogRecord $record) in /... .../RedactSensitiveProcessor.php on line 34

Originally created by @ballcorn on GitHub (Dec 3, 2022). Original GitHub issue: https://github.com/Seldaek/monolog/issues/1780 Monolog version 3? I see some plugins and scripts to remove PII from monolog logs, but everything i have found is realted to Monolog 2. How can i remove information like CreditCard data from any logs? Here's and example i found for Monolog 2.0 If I implement what is here with Monolog 3, I get the following error. Fatal error: Declaration of RedactSensitive\RedactSensitiveProcessor::__invoke(array $record): array must be compatible with Monolog\Processor\ProcessorInterface::__invoke(Monolog\LogRecord $record) in /... .../RedactSensitiveProcessor.php on line 34
kerem 2026-03-04 02:17:38 +03:00
  • closed this issue
  • added the
    Support
    label
Author
Owner

@Seldaek commented on GitHub (Feb 4, 2023):

Yes.. you need to port the code to work with Monolog 3, see https://github.com/Seldaek/monolog/blob/main/UPGRADE.md

<!-- gh-comment-id:1416853577 --> @Seldaek commented on GitHub (Feb 4, 2023): Yes.. you need to port the code to work with Monolog 3, see https://github.com/Seldaek/monolog/blob/main/UPGRADE.md
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#749
No description provided.