Il 11/05/2016 11:30, xnrl ha scritto:
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.
That's strange
------------------ # 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.
I can't understand what do you mean with "except for the same line as in test", how is script1 different than testscript?.
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
That's an unmaintained old uwsgi version. Debian jessie shipped with 2.0.7 btw, any chance you can try that? Or a more recent version?
-- Riccardo Magliocchetti @rmistaken http://menodizero.it _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
