In Confluent.Kafka, there is a SetLogHandler method for configuring logging in producers and consumers. It is available through the ProducerBuilderFactory and ConsumerBuilderFactory properties. However, there is no way in this method to get an instance of the ILogger object, which is used by the corresponding classes.
Because of this, when configuring the logging of events occurring inside librdkafka, you have to use a static instance of the logger. And the static logger may lack the necessary context that specific IConsumer and IProducer instances have.
Maybe I'm missing something, but after studying the repository, I haven't found any mechanisms that would allow me to do this.

In Confluent.Kafka, there is a SetLogHandler method for configuring logging in producers and consumers. It is available through the ProducerBuilderFactory and ConsumerBuilderFactory properties. However, there is no way in this method to get an instance of the ILogger object, which is used by the corresponding classes.
Because of this, when configuring the logging of events occurring inside librdkafka, you have to use a static instance of the logger. And the static logger may lack the necessary context that specific IConsumer and IProducer instances have.
Maybe I'm missing something, but after studying the repository, I haven't found any mechanisms that would allow me to do this.