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

2024-03-28 11:09:05 发布

您现在位置:Python中文网/ 问答频道 /正文

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

有人能提供一些见解吗!你知道吗


Tags: 文件thenameinselfinfolog应用程序