推荐学习书目
› 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
shyrock
V2EX  ›  Python

logging 模块偶尔丢日志

  •  
  •   shyrock · Apr 22, 2021 · 1659 views
    This topic created in 2026 days ago, the information mentioned may be changed or developed.
    我的服务每分钟会写一条日志,但是发现偶尔会没有日志。
    数据库中的 trigger 记录下来每分钟正确的修改了记录,但是日志文件里面却没有记录。

    有人有解决思路建议嘛?
    3 replies  •  2021-05-07 13:25:05 +08:00
    wingor2015
    wingor2015
    Apr 28, 2021
    1
    有多个进程操作这个日志文件吗?
    shyrock
    shyrock
    OP
    Apr 28, 2021
    2
    @wingor2015 #1 有的,是多个进程。我在 google 上搜索,看到如果开启 rotate 日志,有可能在多线程条件下会丢日志,但是我并没有开启 rotate 。
    luckyc
    luckyc
    May 7, 2021
    3
    换 loguru
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   807 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 17:20 · PVG 01:20 · LAX 09:20 · JFK 12:20
    ♥ Do have faith in what you're doing.