Reputation: 2230
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.
Upvotes: 6
Views: 3303
Reputation: 32398
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.
Upvotes: 8