Skip to content

Conversation

@mahendra
Copy link

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).

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
@williamsjj
Copy link
Collaborator

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.

@objcode
Copy link
Owner

objcode commented Mar 22, 2011

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants