推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
RicardoScofileld
V2EX  ›  Python

一个关于 flask 日志的问题

  •  
  •   RicardoScofileld · Jun 7, 2018 · 2920 views
    This topic created in 2921 days ago, the information mentioned may be changed or developed.

    我在蓝图中用 current_app.logger.error(),为何不会写入到日志文件中啊

    2 replies    2018-06-08 15:56:26 +08:00
    reself
        1
    reself  
       Jun 7, 2018 via Android
    要把 filehandle 注册到 logger 里
    RicardoScofileld
        2
    RicardoScofileld  
    OP
       Jun 8, 2018
    @reself logging.getLogger().addHandler(file_log_handler)
    这一句可以给,应用实例 app 添加上 logger 吗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2814 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 10:14 · PVG 18:14 · LAX 03:14 · JFK 06:14
    ♥ Do have faith in what you're doing.