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

如果将 scrapy 的错误日志直接存入到 mysql 中?

  •  
  •   pc10201 · Oct 8, 2014 · 4842 views
    This topic created in 4370 days ago, the information mentioned may be changed or developed.
    scrapy可以将日志存到一个文件当中,不过好像不太方便分析,因为有许多错误原因是相同的,然后反复往里面写,看起来比较累,我想直接写到数据库中方便分析一些

    我试了一下,在pipelines.py中直接写数据库语言好像不起作用
    开发环境是win7,python最新版32位,scrapy最新版
    2 replies  •  2014-10-31 11:51:18 +08:00
    Codist
        1
    Codist  
       Oct 8, 2014
    没有碰见过直接入库的日志模块,日志入库一般是写脚本扫描日志文件吧,日志文件分析蛮方便的。不知道在win下是什么感受。这种需求重新实现scrapy的log模块么。
    Melodic
        2
    Melodic  
       Oct 31, 2014
    可以考虑自己写个Middleware来处理,log也在middleware中记录
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2566 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 12:55 · PVG 20:55 · LAX 05:55 · JFK 08:55
    ♥ Do have faith in what you're doing.