PHP code example of drips / logger

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

    

drips / logger example snippets




use Drips\Logger\Logger;
use Monolog\Handler\StreamHandler;

$logger = new Logger('myLogger');
$logger->pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING)); // StreamHandler => schreibt in eine Datei

// Logeinträge hinzufügen
$logger->warning('Warning');
$logger->error('Error');



use Drips\Logger\Logger;
use Drips\Logger\Handler;

// Neuen Logger anlegen
$logger = new Logger('myLogger');

// DebugbarHandler registrieren
$logger->pushHandler(new Handler);