PHP code example of genai / trace

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

    

genai / trace example snippets


   $logger->pushProcessor(new \GenAI\Trace\Monolog\TraceProcessor());
   // every record now carries extra.trace_id
   
ini
   [trace]
   header = X-Request-Id    ; the correlation header (default)