On 07/13/2012 09:41 PM, Roberto De Ioris wrote:
I think this is getting old....

Please, how do I run a Pyramid 1.3 app, full with logging as specified
in the .ini file, under uWSGI.

uwsgi --http :8080 --ini-paste-logged deployement.ini

(substitute deployment.ini with your config file).

You have to use at least uWSGI 1.2



I must admit I didn't try directly from command line, but I use uwsgi config INI because of vassals and several sites run under same uwsgi server, so I like to drop them in /etc/uwsgi.d/ which I configured in my custom sysvinit script.

So this is my config INI (not the paste INI):

[uwsgi]
master = true
processes = 1
enable-threads = true
single-interpreter = true
threads = 2
uid = siteuser
gid = siteuser
paste = config:/home/siteuser/Sitename/production.ini
chdir = /home/siteuser
virtualenv = /home/siteuser/Sitename/virtualenv
socket = /tmp/uwsgi/uwsgi-sitename.socket


So instead of "paste" I tried "ini-paste-logged" (assuming command line parameters are equal to the INI params), and it doesn't work. I mean the site works but the logging config is not picked up.


Meanwhile I found a way on another thread on the list. Basically, add custom entry in production.ini, say "logging.config" (or whatever), and then in the __init__'s main:

logging.config.fileConfig(settings["logging.config"]) # or whatever the entry in .ini is


This works for now, but I don't think it's very elegant. I was looking for a way to get the INI path in main() without having to resort to settings tricks, but either I missed it in the docs, or there is no way. Methinks whatever pserve is doing should be exposed (if it isn't already and I missed it) to main().


Thanks.

--

.oO V Oo.

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to