monolog icon indicating copy to clipboard operation
monolog copied to clipboard

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

Open ballcorn opened this issue 3 years ago • 1 comments

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

ballcorn avatar Dec 03 '22 02:12 ballcorn

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

Seldaek avatar Feb 04 '23 21:02 Seldaek