Hello,
I've got a bit of a strange problem while trying to utilize a mule.
I start uwsgi from shell like this: "uwsgi --protocol http --plugins
python3 --socket :8080 --mule=script /srv/www/app/main.py --uid user"
At one point I noticed that logging doesn't work - neither to a file
nor to stdout; so I created a very simple script to test it:
------------------
#!/usr/bin/python3
import logging
logging.basicConfig(filename = '/var/log/app/app.log', level = logging.DEBUG)
log = logging.getLogger('log')
log.debug('--> testscript working')
------------------
and it sort of worked - only the output appeared not in the file but on stdout.
------------------
# uwsgi --protocol http --plugins python3 --socket :8080
--mule=testscript /srv/www/app/main.py --uid user
[...]
spawned uWSGI master process (pid: 25224)
spawned uWSGI worker 1 (pid: 25238, cores: 1)
spawned uWSGI mule 1 (pid: 25239)
DEBUG:log:--> testscript working
------------------
I then proceeded to comment everything in the 'script1' except for the
same line as in test - and the result is nothing at all, I don't see
the log line anywhere.
Permissions on the logfile are 777, owned by the user under whom uwsgi
is run (by the --uid option). Both scripts have the same
permissions/ownership, reside in the same directory and work as
intended when started from shell. I did a diff on both files to
determine if the uncommented lines are the same (grepped them with
"grep -vE '(^#)|(^\s*$)' script > /tmp/diffX") - they are.
Also tried writing something to a file, with and without "if __name__
== '__main__'" clause - test script works, original doesn't.
I can't understand why basically identically scripts work differently,
or why the log doesn't go where it should.
Do I completely misunderstand how mules are supposed to operate, or is
it a simpler problem I'm facing?
Using uwsgi 1.2.3+dfsg-5+deb7u1 from repos on debian jessie with python 3.2.3-6
Thanks in advance.
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi