stseira / monolog-kafka
Apache Kafka handler for Monolog
Installs: 405
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 10
pkg:composer/stseira/monolog-kafka
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: 2025-12-19 09:48:17 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.