Redirect Scrapy log messages to standard Python logger


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.