PHP code example of patrickmaken / kafka-log-driver

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

    

patrickmaken / 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' => Patrickmaken\KafkaLogDriver\KafkaLogger::class,
    ],
    ...
],
bash
php artisan vendor:publish --tag="kafka-log-driver-config"