Seldaek / monolog

Sends your logs to files, sockets, inboxes, databases and various web services
https://seldaek.github.io/monolog/
MIT License
21.02k stars 1.9k forks source link

How Remove PII (Personal Information) from MonoLog log files? #1780

Open ballcorn opened 1 year ago

ballcorn commented 1 year ago

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

Seldaek commented 1 year ago

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