From 52dc0deb2bf29cbe91b2ede4033181a77f9c0537 Mon Sep 17 00:00:00 2001 From: Nightt <87569709+nightt5879@users.noreply.github.com> Date: Wed, 24 Jun 2026 18:40:42 +0800 Subject: [PATCH] docs: clarify LOG_FILE with multiple spiders --- docs/topics/settings.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/topics/settings.rst b/docs/topics/settings.rst index 455985a56..a9e506ac8 100644 --- a/docs/topics/settings.rst +++ b/docs/topics/settings.rst @@ -361,6 +361,14 @@ All of these settings, except for :setting:`ASYNCIO_EVENT_LOOP`, are only used when the Twisted reactor is used, i.e. when :setting:`TWISTED_REACTOR_ENABLED` is ``True``. +Logging settings +---------------- + +:setting:`LOG_FILE` is a global logging setting. It can be defined from a +spider, but when multiple spiders run in the same process, for example with +:class:`~scrapy.crawler.CrawlerProcess`, it cannot be used as a per-spider log +destination through :attr:`~scrapy.Spider.custom_settings`. + .. _topics-settings-ref: Built-in settings reference @@ -1460,6 +1468,12 @@ Default: ``None`` File name to use for logging output. If ``None``, standard error will be used. +This is a global logging setting. When running multiple spiders in the same +process, for example with :class:`~scrapy.crawler.CrawlerProcess`, +:setting:`LOG_FILE` cannot be used as a per-spider log destination through +:attr:`~scrapy.Spider.custom_settings`. See :ref:`topics-logging-settings` for +more information about logging configuration. + .. setting:: LOG_FILE_APPEND LOG_FILE_APPEND