Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling logs when running Scrapy as script

I'm using Scrapy in a script of mine as describe in the Common Practices on the docs

I need to disable the Scrapy logs completely (not change verbosity). I tried this:

Spider.custom_settings['LOG_ENABLED'] = False

and this:

configure_logging({'LOG_ENABLED': False})

In both cases, Scrapy is still logging everything.

How do you completely disable Scapy logs when running Scrapy in a script (note that I have my own logger that I want to keep, it's just Scrapy logs that I want to remove).

like image 916
Jimmy Sanchez Avatar asked Jun 15 '26 00:06

Jimmy Sanchez


1 Answers

I was able to solve this by using:

logging.getLogger('scrapy').propagate = False
like image 189
Jimmy Sanchez Avatar answered Jun 16 '26 14:06

Jimmy Sanchez