[Twisted-Python] running twisted with supervisord -- logging question

Jonathan Vanasco twisted-python at 2xlp.com
Sat Aug 23 17:46:25 MDT 2014


Christopher-

Thanks for the insight.  I was stupid and didn't include my code.

I don't actually want supervisor to handle the logging.  I wanted to have this app's logs in /var/log/myapp-twisted/twisted.log

I just can't figure out how to make this happen.  i've been playing with different permutations of twistd commands, redirect_stderr and stdout_logfile, and haven't found the right balance

the actual logging calls are just to python's logger ( `import logging` ; logging.getLogger(), log.debug(), etc)

---------
[program:myapp-twisted]
priority=100
process_name=%(program_name)s
autostart=true
autorestart=true
stopsignal=QUIT
redirect_stderr = false
stdout_logfile = /var/log/myapp-twisted/twisted.log
directory = /var/www/sites/myapp-svn_tag-current_production/daemon/twisted
environment = PATH="/var/www/sites/myapp-virtualenv/bin:$PATH"
command = /var/www/sites/myapp-virtualenv/bin/twistd -y controller-production.tac --pidfile /tmp/myapp-twisted.pid
----------





On Aug 22, 2014, at 11:50 PM, Christopher Armstrong wrote:

> 
> On August 22, 2014 at 6:52:02 PM, Jonathan Vanasco (twisted-python at 2xlp.com) wrote:
> 
>> hoping someone can answer this question- 
>> 
>> i can't seem to get my logging right while using supervisord 
>> 
>> i'm not using twisted logging, just the regular python logging infrastructure. 
>> 
>> the two end-results I've had: 
>> 
>> - everything double-logs into twistd.log & /var/log/supervisor.log 
>> - anything this is `print`'ed appears in my twistd.log , but none of the `log.debug()` lines appear 
>> 
>> the end result I want, is for debug info from the twisted process to be recorded in a single file 
> 
> 
> I prefer to use
> 
> 
> 
> 	twistd -n -l - ...
> 
> 
> 
> passing ‘-' to -l means “log to stdout”.
> 
> 
> 
> Without your code, we can’t know how you’re configuring python logging, and what may be wrong with it. This should be the baseline for using twistd with supervisor if you want to let supervisor handle logging. FYI, you can configure supervisor to put the output in a different file than /var/log/supervisor.log, too.
> 
> 
> 
> -- 
> Christopher Armstrong
> http://twitter.com/radix
> http://wordeology.com/
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

// Jonathan Vanasco

c. 646.729.6436  |  415.501.9815
e. jonathan at 2xlp.com
w. http://findmeon.com/user/jvanasco 
linkedin. http://linkedin.com/in/jonathanvanasco
blog. http://destructuring.net

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20140823/7a9549a7/attachment-0002.html>


More information about the Twisted-Python mailing list