推荐学习书目
› 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 · 1569 views
    This topic created in 1988 days ago, the information mentioned may be changed or developed.
    我的服务每分钟会写一条日志,但是发现偶尔会没有日志。
    数据库中的 trigger 记录下来每分钟正确的修改了记录,但是日志文件里面却没有记录。

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