(PECL rdkafka >= 4.0.0, librdkafka >= 0.9.4)
RdKafka\Conf::setLogCb — Set log callback
Set log callback. You will get events according to log_level
that was set in RdKafka\Conf
Note:
HINT: The extension takes care of setting
log.queue
totrue
in RdKafka\Conf which is needed for this.
Returns no value.
Example #1 RdKafka\Conf::setLogCb() example
<?php
$conf->setLogCb(function ($kafka, $level, $facility, $message) {
printf("Kafka %s: %s (level: %d)\n", $facility, $message, $level);
});
?>