Posted By

scrapy on 09/01/12


Tagged

logging scrapy


Versions (?)

Redirect Scrapy log messages to standard Python logger


 / Published in: Python
 

  1. # Redirect Scrapy log messages to standard Python logger
  2.  
  3. ## Add the following lines to your Scrapy project's settings.py file
  4. ## This will redirect *all* Scrapy logs to your standard Python logging facility
  5.  
  6. from twisted.python import log
  7. observer = log.PythonLoggingObserver()
  8. observer.start()
  9.  
  10. # Snippet imported from snippets.scrapy.org (which no longer works)
  11. # author: saidimu
  12. # date : Jun 14, 2011
  13.  

Report this snippet  

You need to login to post a comment.