paisley icon indicating copy to clipboard operation
paisley copied to clipboard

Replace python logger with twisted log

Open mahendra opened this issue 13 years ago • 2 comments

Python logging uses blocking APIs. Hence it must not be used in twisted code. A blocking log message can block the entire twisted event loop.

Refer to: http://twistedmatrix.com/documents/10.2.0/core/howto/logging.html#auto3

Although there is a twisted observer for this, it is still a blocking API. It is not a good practice to use it. (if somebody configures a db based log, it will block).

mahendra avatar Mar 22 '11 12:03 mahendra

I don't think it's a bad idea to swap in the Twisted logger. That said the Twisted logger also blocks unless you're using the syslog observer. I made an attempt at fixing this in Twisted but got bogged down in the inane review process. If Sean is alright with this direction I'd advocate integrating it. His call though since he's working on the logging refactor.

williamsjj avatar Mar 22 '11 16:03 williamsjj

Twisted logging looks good, will merge once I get a chance to make some of the new log lines grepable with prefixes.

objcode avatar Mar 22 '11 17:03 objcode