Infinite loop if added to root handler
Opened this issue · 0 comments
epa095 commented
If this log handler is attached to the root handler with loglevel DEBUG you will receive the log-messages from the request library and url3lib, again triggering new log messages from those library, resulting in an infinite loop of messages. I come over the same bug when I tried to write my own log-handler, and I have described the issue in more detail on stackoverflow.
How to reproduce:
import logging
import loggly.handlers
mylogger = logging.getLogger()
myhandler = loggly.handlers.HTTPSHandler("YourUrl","POST")
mylogger.addHandler(myhandler)
mylogger.setLevel(logging.DEBUG)
mylogger.info("message")
You can set YourURL to "http://127.0.0.1:6000" and then use nc -k -l 6000
to see the connections flowing inn (you might need to press enter in the nc window to make it flush its output buffer).