stseira / monolog-kafka
Apache Kafka handler for Monolog
v1.0.3
2020-07-22 09:00 UTC
Requires
- php: >=5.3.0
- ext-rdkafka: >=1.0
- monolog/monolog: ^1.20.0
Requires (Dev)
- phpunit/phpunit: ^5.5
This package is not auto-updated.
Last update: 2024-09-27 04:12:21 UTC
README
Support for logging into Apache Kafka using rdkafka extension (there are a few libraries for PHP, but this once seems to be most mature and supports Kafka versions 0.8, 0.9 & 0.10).
Usage example:
$config = new \RdKafka\Conf();
$config->set('metadata.broker.list', '127.0.0.1');
$producer = new \RdKafka\Producer($config);
$logger = new Logger('my_logger');
$logger->pushHandler(new KafkaHandler($producer, 'test'));
Works with:
- PHP 5.6 & rdkafka 1.*
- PHP 7+ & rdkafka 2.* and 3.*
Manually tested with Apache Kafka 0.10.1.