BewareMyPower commented on issue #216:
URL: 
https://github.com/apache/pulsar-client-python/issues/216#issuecomment-2221861880

   It seems that you need to set `logging.basicConfig` first.
   
   In my local env, the following code print no logs:
   
   ```python
   pulsar_logger = logging.getLogger("pulsar")
   pulsar_logger.setLevel(logging.INFO)
   client = pulsar.Client('pulsar://localhost:6650', logger=pulsar_logger)
   # ...
   ```
   
   However, after adding `logging.basicConfig(level=logging.INFO)` before the 
1st line, it worked.
   
   ```
   INFO:pulsar:[<none> -> pulsar://localhost:6650] Create ClientConnection, 
timeout=10000
   INFO:pulsar:Created connection for 
pulsar://localhost:6650-pulsar://localhost:6650-0
   ```
   
   And I can also change the log level to bug with 
`pulsar_logger.setLevel(logging.DEBUG)`:
   
   ```
   DEBUG:pulsar:Using Binary Lookup
   DEBUG:pulsar:Run io_service in a single thread
   ``` 
   
   But after removing the `basicConfig` call, the debug logs disappeared.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to