PHP code example of cascade-energy / monolog-kinesis-handler

1. Go to this page and download the library: Download cascade-energy/monolog-kinesis-handler 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/ */

    

cascade-energy / monolog-kinesis-handler example snippets




$kinesis = new \Aws\Kinesis\KinesisClient(['region' => 'us-west-2', 'version' => 'latest']);

$kinesisHandler = new \CascadeEnergy\Monolog\Handler\KinesisHandler($kinesis, 'kinesis-stream-name');

$logger = new \Monolog\Logger('log-channel');
$logger->pushHandler($kinesisHandler);

$logger->notice('Off we go to Kinesis.');