Satish Michael
Satish Michael

Reputation: 2015

Twilio Python Logging Level

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

Upvotes: 3

Views: 880

Answers (1)

philnash
philnash

Reputation: 73057

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.

Upvotes: 6

Related Questions