Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twilio Python Logging Level

Tags:

twilio

How do I set the logging level of twilio python package. My script has a logging config to direct all logs to a file. I would like to limit twilio to log only Warnings.

Thank you

like image 797
Satish Avatar asked Jun 26 '26 21:06

Satish


1 Answers

Twilio developer evangelist here.

The Twilio Python client uses a logger called 'twilio.http_client' to log HTTP requests. You should be able to set the log level for the logger with the following:

 import logging
 twilio_logger = logging.getLogger('twilio.http_client')
 twilio_logger.setLevel(logging.WARNING)

Let me know if that helps at all.

like image 140
philnash Avatar answered Jun 28 '26 17:06

philnash



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!