Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdminClient does not work with logger #1734

Closed
pavelschon opened this issue Apr 23, 2024 · 2 comments
Closed

AdminClient does not work with logger #1734

pavelschon opened this issue Apr 23, 2024 · 2 comments
Labels
enhancement usage Incorrect usage

Comments

@pavelschon
Copy link

pavelschon commented Apr 23, 2024

Description

Log messages are not logged via logger.

How to reproduce

import logging
import sys

from confluent_kafka.admin import AdminClient

logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
logger=logging.getLogger("AdminClient")
logger.info("Running...")

client = AdminClient({
    "bootstrap.servers": "localhost:9999",
    "logger": logger
})

client.list_topics(timeout=1)

I would expect to see a log record such as:

%3|1713881891.083|FAIL|rdkafka#producer-1| [thrd:localhost:9999/bootstrap]: localhost:9999/bootstrap: Connect to ipv4#127.0.0.1:9999 failed: Connection refused (after 0ms in state CONNECT)

Python: 3.12.1
Confluent-Kafka version: ('2.3.0', 33751040)

@pranavrth
Copy link
Member

Yes there is some issue in logger with AdminClient. Its similar to #1699. Marking it as bug to investigate it further. Hopefully, we will be able to take this up later this quarter.

@pranavrth pranavrth added the bug label Apr 29, 2024
@pranavrth pranavrth added enhancement usage Incorrect usage and removed bug labels May 31, 2024
@pranavrth
Copy link
Member

You can use admin_client.poll to serve the logs through the custom logger.

I have updated the other thread where more discussion will continue. Closing this ticket so that all the discussion can happen at one place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement usage Incorrect usage
Projects
None yet
Development

No branches or pull requests

2 participants