将Flask 日志整合到Gunicorn日志并输出
Example Code
# coding: utf-8
import logging
from flask import Flask, jsonify
app = Flask(__name__)
@app.route('/')
def index():
app.logger.debug('this is debug message')
app.logger.error('this is error message')
app.logger.critical('this is critical message')
return 'ok'
if __name__ != '

本文介绍如何将Flask应用的日志与Gunicorn服务器日志进行整合,通过Example Code展示了具体实现过程,并提供了运行指令。
最低0.47元/天 解锁文章
2062

被折叠的 条评论
为什么被折叠?



