from scrapy import log
logfile = open('testlog.log', 'a')
log_observer = log.ScrapyFileLogObserver(logfile, level=log.DEBUG)
log_observer.start()
Scrapy - logging to file and stdout simultaneously, with spider names