PHP code example of rrbrr / rlog

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

    

rrbrr / rlog example snippets



$whiteList =['127.0.0.1'];
$requestParams = get_http_request_data($whiteList);
if(!is_array($data)){
    $logId = Db::name('log_request')->insertGetId($data);
}
        

 $dbConfig = [
    'database_type' => 'mysql',
    'database_name' => 'test',
    'server'        => 'localhost',
    'username'      => 'root',
    'password'      => '123456'
];
$data = [];
$data['user_id'] = 123;
$objCurl = new \rlog\CurlLog($dbConfig);
$objCurl->curlPost($url,$data,$headers);