PHP code example of doclassif / elastic

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

    

doclassif / elastic example snippets


     'channels' => [
        'stack' => [
            'driver' => 'stack',
            'channels' => ['stdout', 'daily', 'elasticsearch'],
            'ignore_exceptions' => false,
        ],

         'elasticsearch' => [
            'driver'         => 'monolog',
            'level'          => 'debug',
            'handler'        => Kali\Elastic\ElasticsearchHandler::class,
            'formatter'      => Kali\Elastic\ElasticsearchFormatter::class,
            'formatter_with' => [
                'index' => env('ELASTIC_LOGS_INDEX'),
                'type'  => '_doc',
            ],
            'handler_with'   => [
                'hosts' => [env('ELASTIC_HOST', "http://elasticsearch:9200/")],
                'options' => [
                    'ignore_error' => env('ELASTIC_IGNORE_ERROR', true),
                ]
            ],
        ],
    ],

 artisan vendor:publish
config/logging.php