PHP code example of shikachuu / jogger

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

    

shikachuu / jogger example snippets



declare(strict_types=1);

use Jogger\Logger;
use Jogger\Output\StdoutOutput;

ogger->setTimeFormatISO8601();
$logger->addString("name", "John")
    ->addFloat("favoriteNumber", 1.33)
    ->addArray("favoritePokemons", ["Lucario", "Terrakion", "Darkrai"])
    ->alert("New user created for role {role}", ["role" => "admin"]);


declare(strict_types=1);

use Jogger\Logger;
use Jogger\Output\StdoutOutput;

logger->setTimeFormatUnix();

try {
    throw new DomainException("Oh something went wrong", 2034);
} catch (DomainException $exception) {
    $logger->addException("domainError", $exception)->error("Failed to serve client");
    // do the error handling
}