hhxsv5 / laravel-kafka-logger
The Kafka logger for Laravel.
Installs: 10 201
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.1.0
- ext-rdkafka: >=4.0.0
Requires (Dev)
- laravel/framework: >=6.0.0
This package is auto-updated.
Last update: 2024-10-15 17:56:59 UTC
README
The Kafka logger for Laravel.
Requirements
Install
1.Install rdkafka
.
git clone --depth 1 https://github.com/edenhill/librdkafka.git /tmp/librdkafka && cd /tmp/librdkafka && ./configure && make -j$(nproc) && make install && rm -rf /tmp/librdkafka pecl install rdkafka
2.Install laravel-kafka-logger
.
# Laravel 5.x composer require "hhxsv5/laravel-kafka-logger:~1.0.0" # Laravel 6.x & 7.x composer require "hhxsv5/laravel-kafka-logger:~2.0.0"
Get Started
1.Modify config/logging.php
.
return [ 'channels' => [ // ... 'kafka' => Hhxsv5\LKL\KafkaLogger::getDefinition(['topic' => env('LOG_KAFKA_TOPIC', 'laravel-logs')]), ], ];
2.Modify .env
.
LOG_CHANNEL=kafka
LOG_KAFKA_BROKER_LIST=kafka:9092
LOG_KAFKA_TOPIC=laravel-logs