PHP code example of aoyagikouhei / slim-fluent-logwriter

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

    

aoyagikouhei / slim-fluent-logwriter example snippets

 bash
$ php composer.phar install
 php
$writer = new \Slim\FluentLogwriter(array('host' => 'localhost'));
$app = new \Slim\Slim(array(
  'log.writer' => $writer,
));
 php
$callable = function($logger, $entity, $error) {
    throw $error;
};
$writer = new \Slim\FluentLogwriter(array(
  'host' => 'localhost',
  'port' => '24224',
  'tag' => 'mongo.systemlog',
  'level' => \Slim\Log::INFO,
  'tag_with_date' => 'Ym',
  'error_handler' => $callable
));
$writer->addFluent(array(
  'host' => 'localhost',
  'port' => '24224',
  'tag' => 'mail.systemlog',
  'level' => \Slim\Log::WARN
));
$app = new \Slim\Slim(array(
  'log.writer' => $writer,
));