I run my uwsgi with --daemonzie=~/uwsgi.log
.
I use flask. In my flask app, if I print some message into stdin
, it will show on uwsgi.log
. If I print to stderr
, uwsgi.log
won't show these message. How should I enable uwsgi to collect message from stderr
.
The major problem is that I can not let uwsgi.log collect the exception track after I catch some exceptions in my flask app.
Flask is catching your exceptions, make sure, you set PROPAGATE_EXCEPTIONS
in config.
from flask import Flask
application = Flask(__name__)
application.config['PROPAGATE_EXCEPTIONS'] = True
@application.route('/')
def hello_world():
return 'Hello World!'
Uwsgi logging can be set with
--logto /var/log/uwsgi/app.log
or use logto2
flag if if you want to separate stdout
from stderr
.
There's also possibility of setting loggers plugin (forward to syslog, etc.), however these plugins have to be compiled into uwsgi.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With