Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scrapy: how to disable or change log?

Tags:

python

scrapy

I've followed the official tutoral of Scrapy, it's wonderful!

I'd like to remove all of DEBUG messages from console output. Is there a way?

2013-06-08 14:51:48+0000 [scrapy] DEBUG: Telnet console listening on 0.0.0.0:6029 2013-06-08 14:51:48+0000 [scrapy] DEBUG: Web service listening on 0.0.0.0:6086 

The doc told about to set a LOG_LEVEL, but ... in which file ?

Replying, please make referring to this directory structure. It's the mine. Plus, I've a 'test.py' in spyder folder

tutorial/     scrapy.cfg     tutorial/         __init__.py         items.py         pipelines.py         settings.py         spiders/             __init__.py             ... 

Where. in which file, and HOW must i set the log_level ?

like image 916
realtebo Avatar asked Jun 08 '13 14:06

realtebo


People also ask

How do you use Scrapy logs?

Logging is a ready-to-use material, which can work with Scrapy settings listed in Logging settings. Scrapy will set some default settings and handle those settings with the help of scrapy. utils. log.

How do you stop a Scrapy shell?

Finally you hit Ctrl-D (or Ctrl-Z in Windows) to exit the shell and resume the crawling: >>> ^D 2014-01-23 17:50:03-0400 [scrapy.


2 Answers

You need to add the following to your settings.py document:

LOG_LEVEL = 'INFO' 

See the documentation.

like image 144
icecrime Avatar answered Sep 19 '22 11:09

icecrime


You can also disable it completely with LOG_ENABLED=False. And you can pass settings when invoking the command: scrapy crawl myspider -s LOG_ENABLED=False

like image 29
Capi Etheriel Avatar answered Sep 22 '22 11:09

Capi Etheriel