We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Pulsar 3.1.0 Pulsar-Client Python 3.3.0 OS : Ubuntu 20.04
import logging import pulsar if __name__ == '__main__': logger_1 = logging.getLogger('pulsar_logger_1') hdlr = logging.StreamHandler() log_format = "pulsar_logger_1: [%(asctime)s] [%(levelname)s]: %(message)s" logger_1.setLevel(logging.INFO) formatter = logging.Formatter(fmt=log_format) hdlr.setFormatter(formatter) logger_1.addHandler(hdlr) logger_1.propagate = False client = pulsar.Client('pulsar://localhost:6650', logger=logger_1) consumer = client.subscribe('my-topic', 'my-subscription') consumer.close() client.close() logger_2 = logging.getLogger('pulsar_logger_2') hdlr = logging.StreamHandler() log_format = "pulsar_logger_2: [%(asctime)s] [%(levelname)s]: %(message)s" logger_2.setLevel(logging.INFO) formatter = logging.Formatter(fmt=log_format) hdlr.setFormatter(formatter) logger_2.addHandler(hdlr) logger_2.propagate = False client_2 = pulsar.Client('pulsar://localhost:6651', logger=logger_2) consumer_2 = client_2.subscribe('my-topic', 'my-subscription2') consumer_2.close() client_2.close() client_3 = pulsar.Client('pulsar://localhost:6650', logger=None) consumer_3 = client_3.subscribe('my-topic', 'my-subscription3') consumer_3.close() client_3.close()
I would expect the first client to use pulsar_logger_1, the second to use pulsar_logger_2 and the third one to use the default logger.
All clients use pulsar_logger_1
It seems that subsequent defined pulsar clients fail to set the logger and keep the first one defined instead.
The text was updated successfully, but these errors were encountered:
Yeah, it's the design flaw of the logger config in this library.
Sorry, something went wrong.
No branches or pull requests
Search before asking
Version
Pulsar 3.1.0
Pulsar-Client Python 3.3.0
OS : Ubuntu 20.04
Minimal reproduce step
What did you expect to see?
I would expect the first client to use pulsar_logger_1, the second to use pulsar_logger_2 and the third one to use the default logger.
What did you see instead?
All clients use pulsar_logger_1
Anything else?
It seems that subsequent defined pulsar clients fail to set the logger and keep the first one defined instead.
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: