记录每个作业的scrapyd日志文件

问题描述 投票:0回答:1

我将我的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

请有人提供一些见解!

python scrapy scrapyd
1个回答
0
投票

找到原因。因为我补充说:

LOGGER.propagate = False
© www.soinside.com 2019 - 2024. All rights reserved.