PHP code example of alexusmai / kafka-log-driver

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

    

alexusmai / kafka-log-driver example snippets


return [
    // topic name
    'topic'         => env('KAFKA_LOG_FILE_TOPIC'),
    // kafka brokers - "10.0.0.1,10.0.0.2"
    'brokers'       => env('KAFKA_LOG_BROKERS'),
    // timeout - ms
    'flush_timeout' => env('KAFKA_LOG_FLUSH_TIMEOUT', 100)
];

'channels' => [
    ...
    'kafka' => [
        'driver' => 'custom',
        'via' => Alexusmai\KafkaLogDriver\KafkaLogger::class,
    ],
    ...
],
bash
php artisan vendor:publish --tag="kafka-log-driver-config"