0

In my Django project, I'm using suds, which logs to a predetermined log (suds.client) and doesn't let me configure a different log for its messages. I'm trying to get around this by adding one of the handlers I have defined in settings.py. In my code that uses suds:

    logging.basicConfig(level=logging.INFO)
    suds_logger = logging.getLogger('suds.client')
    suds_logger.setLevel(logging.INFO)
    suds_logger.addHandler('my_handler')
    suds_logger.propagate = False

This is obviously incorrect (because I'm just passing the string naming the handler and not the handler itself) and results in this error:

ERROR:my_handler:'str' object has no attribute 'level'

So, it seems like all I have to do is correctly use the 'my_handler' handler from settings and I should be good to go. So, what is the correct syntax?

Cloud Artisans
  • 4,016
  • 3
  • 30
  • 37

0 Answers0