34

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 ?

Wolf
  • 9,679
  • 7
  • 62
  • 108
realtebo
  • 23,922
  • 37
  • 112
  • 189

3 Answers3

55

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

LOG_LEVEL = 'INFO'

See the documentation.

Maximilian Kohl
  • 632
  • 1
  • 9
  • 23
icecrime
  • 74,451
  • 13
  • 99
  • 111
28

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

Capi Etheriel
  • 3,542
  • 28
  • 49
  • Does case really matter for the `FALSE/False` values? – Wolf Jul 23 '15 at 11:37
  • 1
    I use the above command and get the result: "ValueError: invalid literal for int() with base 10: 'FALSE'". I try to replace "FALSE" with "0" and no error again now. – realjin Sep 17 '15 at 09:24
  • @Wolf it seems False will be parsed as boolean, FALSE will be parsed as string :/ – Capi Etheriel Sep 17 '15 at 18:42
11

You can also use --nolog in command prompt.

> scrapy crawl myspider --nolog

--nolog command Sets LOG_ENABLED to False

see documentation scrapy command line options