我将我的scrapy应用程序部署到scrapyd,并在每个作业的日志文件中:
http://{host}:6800/logs/{project_name}/{spider_name}/{job_id}.log
我没有看到我使用我定义的记录器记录的日志,但如果我将其更改为使用self.logger.info(....),它将显示在jobs的日志文件中。
LOGGER = logging.getLogger(__name__)
LOGGER.info('...') # this not show up in the log file
self.logger.info('...') # this shows up in the log file
请有人提供一些见解!
找到原因。因为我补充说:
LOGGER.propagate = False