Closed regostar closed 4 years ago
import logging from mailchimp3 import MailChimp client = MailChimp(mc_api=<API_KEY>, mc_user=<USER>) fh = logging.FileHandler('log_files/mailchimp_3_log.log') logger = logging.getLogger('mailchimp3.client') logger.addHandler(fh) client.lists.all(**{'fields': 'lists.date_created'}) {'lists': [{'date_created': '2019-11-22T08:20:54+00:00'}]}
The file log_files/mailchimp_3_log.log is empty!
Resolved by adding this :-
logging.getLogger().setLevel(logging.INFO)
The file log_files/mailchimp_3_log.log is empty!