[Twisted-Python] logging in twisted based projects

Stephen Thorne stephen at thorne.id.au
Thu Mar 14 09:52:23 EDT 2013


It's also perfectly fine to use python's logging module from within
twisted, you don't have to use twisted.log, but you should be aware this
will make your log files hard to correlate (between twistd.log and your own
logfiles).


On Thu, Mar 14, 2013 at 10:05 AM, Sergey Gerasimov <sergun at gmail.com> wrote:

> I’m implementing some project based on twisted.****
>
> ** **
>
> I would like to use some logging mechanism in my modules and see both
> twisted generated log records and log records from my modules****
>
> and be able to filter log records by level and  source (generated by
> twisted, or subset of my modules).****
>
> ** **
>
> What should I do in this case?****
>
> Log with python logging module in my code and send log records generated
> by twisted to PythonLoggingObserver? ****
>
> Or should I avoid using of python logging module and log only with twisted
> logging module? I didn’t find features like filtering logs in twisted
> logging.****
>
> ** **
>
> Am I right that twisted based log observer uses blocking i/o? Example:****
>
> observer = log.FileLogObserver(sys.stdout) # sys.stdio.write used in
> implementation****
>
> ** **
>
> ** **
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20130314/6a5d5282/attachment-0001.htm 


More information about the Twisted-Python mailing list