add gunicorn capabilities

This commit is contained in:
Torma Kristóf 2021-11-18 12:07:35 +01:00
parent 94d51c52be
commit bd12718981
1 changed files with 6 additions and 1 deletions

7
app.py
View File

@ -15,4 +15,9 @@ def index():
return jsonify(count=out)
app.run(host="0.0.0.0", port=int("8080"), debug=False)
if __name__ != '__main__':
import logging
gunicorn_logger = logging.getLogger('gunicorn.error')
app.logger.handlers = gunicorn_logger.handlers
app.logger.setLevel(gunicorn_logger.level)