PHP code example of ksardv / php-log-sanitizer

1. Go to this page and download the library: Download ksardv/php-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/ */

    

ksardv / php-log-sanitizer example snippets


use Ksardv\PhpLogSanitizer\PatternRepository;
use Ksardv\PhpLogSanitizer\Sanitizers\JsonSanitizer;

$patterns = PatternRepository::fromFile(config_path('log_mask.php'));
$sanitizer = new JsonSanitizer($patterns);

Log::info($sanitizer->sanitize(json_encode($yourPayload)));