kozlice/monolog-kafka

Apache Kafka handler for Monolog

v2.0.0 2021-06-27 09:16 UTC

This package is not auto-updated.

Last update: 2024-04-27 18:04:21 UTC


README

Build Status

Support for logging into Apache Kafka using rdkafka extension.

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 7.4+ with PECL rdkafka 4.x/5.x
  • PHP 8+ with PECL rdkafka 5.x

Manually tested with Apache Kafka 2.8.0.

If you need support for earlier versions of PHP or rdkafka extension, please check out the v1.0.1 tag.