-
Notifications
You must be signed in to change notification settings - Fork 878
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 doesn't support specifying the logger #1699
Comments
You can use "logger" property inside config.
|
Will the AdminClient code recognize this logger passed as such? |
@pranavrth Can you comment? |
It should work in the way I have mentioned. Is it not working? |
@watpp did @pranavrth's example solve your issue? |
I've been unable to get this to work as well. I've got kafka running locally but have it advertising a domain that doesn't exist so it will produce an error when I try to use import logging
from confluent_kafka.admin import AdminClient
log = logging.getLogger("test")
log.addHandler(logging.FileHandler("test_log.log"))
log.setLevel("INFO")
if __name__ == "__main__":
config = {
"bootstrap.servers": "127.0.0.1:9092",
}
log.info("Creating Client")
client = AdminClient(config)
future = client.describe_cluster(request_timeout=5)
future.result() I get the following:
Then when I add the logger into the config: config = {
"bootstrap.servers": "127.0.0.1:9092",
"logger": log,
} I no longer get anything printed to the screen, but the errors are also not written to |
There is some issue for sure. I am marking it as a bug to further look into it. |
Description
Admin client from the library doesn't support specification of a logger. It generates the error:
TypeError: __init__() got an unexpected keyword argument 'logger
However, the producer and consumer clients do. Is there something I am missing, or is there an alternative to specify the logger in the admin client?
How to reproduce
Checklist
Please provide the following information:
The text was updated successfully, but these errors were encountered: