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