PHP code example of kodus / chrome-logger

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

    

kodus / chrome-logger example snippets


$logger = new ChromeLogger();

$logger->notice("awesome sauce!");

$response = $logger->writeToResponse($response);

$logger->info(
    "INFO",
    [
        "table: SQL Queries" => [
            ["time" => "10 msec", "sql" => "SELECT * FROM foo"],
            ["time" => "20 msec", "sql" => "SELECT * FROM baz"],
        ]
    ]
);

try {
    something_dumb();
} catch (Exception $e) {
    $logger->error("ouch, this looks bad!", ["exception" => $e]);
}

$logger->usePersistence("/var/www/mysite/webroot/logs", "/logs");