PHP code example of engvanntha / request-trace

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

    

engvanntha / request-trace example snippets


use Engvanntha\RequestTrace\Traits\RequestTraceTrait;

class ClassName
{
    use RequestTraceTrait;

    public function functionName(array $data)
    {
        $user = $this->queryUser($data);

        // Log one variable
        $this->traceLog('user', $user);

        // Log selected variables only
        $this->traceLogVars(compact('data', 'user'), array('user'));

        return $user;
    }
}

\Engvanntha\RequestTrace\Middleware\CaptureRequestTrace::class