PHP code example of shalvah / monolog-pusher

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

    

shalvah / monolog-pusher example snippets


$config = ['YOUR_APP_KEY', 'YOUR_APP_SECRET', 'YOUR_APP_ID', ['cluster' => 'YOUR_APP_CLUSTER']];
$handler = new \Shalvah\MonologPusher\PusherHandler($config);

$pusher = new \Pusher\Pusher();
$handler = new \Shalvah\MonologPusher\PusherHandler($pusher);

$logger = new \Monolog\Logger('pusher-logs');
$logger->pushHandler($handler);

$logger->error('oops!');

$handler = new \Shalvah\MonologPusher\PusherHandler($config, \Monolog\Logger::DEBUG);