V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
ysymi
V2EX  ›  Python

请问各位大佬, gunicorn 的 logging 和 Python 程序的自己的 logging 有什么区别和联系?

  •  
  •   ysymi · 2017-12-29 17:19:34 +08:00 · 2706 次点击
    这是一个创建于 2281 天前的主题,其中的信息可能已经有所发展或是发生改变。

    看到 gunicorn 的 settings 里有 accesslog 和 errorlog, 然后一个 python 程序也可以有自己的 logging,这两个 logging 会有冲突?

    目前自己猜测的是: 如果 python 程序自己的 log 写到标准输出,会被 gunicorn 捕获。如果 python 程序自己写到文件里,就不会被 gunicorn 捕获。

    请问老司机们,这两种 logging 是否是猜想的那样?或者说下自己的 logging 实践

    两个参考的文档:

    1. http://docs.jinkan.org/docs/flask/errorhandling.html
    2. http://docs.gunicorn.org/en/stable/settings.html#logging
    1 条回复    2017-12-29 23:16:20 +08:00
    maemo
        1
    maemo  
       2017-12-29 23:16:20 +08:00
    可以看一下我发的帖子,里面有 gunicorn logging 的配置 https://www.v2ex.com/t/418542 ,可我的问题也没解决
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2514 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 16:01 · PVG 00:01 · LAX 09:01 · JFK 12:01
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.