1. Go to this page and download the library: Download adt/log-sanitizer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
adt / log-sanitizer example snippets
$sanitizer = new SensitiveDataSanitizer();
// pole i vnořená struktura
$sanitizer->sanitize(['email' => '[email protected]', 'password' => 'Tajne123']);
// => ['email' => '[email protected]', 'password' => '***']
// surové tělo requestu: JSON dovnitř, JSON zpátky
$sanitizer->sanitizeJson($httpRequest->getRawBody());
// hlavičky: nositele přístupu vyhodí úplně
$sanitizer->sanitizeHeaders($headers);
$sanitizer->addSensitiveKeys('rodneCislo', 'iban');
// escape hatch, když porovnání podle slov nestačí
new SensitiveDataSanitizer(sensitivePatterns: ['/^x-internal-/i']);