shengchenyang / AyugeSpiderTools

使 scrapy 开发不用在意 item,pipeline,middleware 等通用场景下模块的编写,解放开发者的双手。
https://ayugespidertools.readthedocs.io
MIT License
75 stars 12 forks source link

How to output scrapy log information on the terminal #18

Closed georgeJzzz closed 8 months ago

georgeJzzz commented 8 months ago

Question description

How to output scrapy log information on the terminal

During the debugging phase, I still hope that scrapy related logs can be output in the terminal. How to control this?

image

shengchenyang commented 8 months ago

scrapy log and ayugespidertools slog are enabled by default in the template, and the output level is ERROR.

During debugging, you can comment out the following section in settings.py:

LOG_LEVEL = "ERROR"
LOG_FILE = _ / "logs/$project_name.log"
logger.add(
    _ / "logs/error.log",
    level="ERROR",
    rotation="1 week",
    retention="7 days",
    enqueue=True,
)
georgeJzzz commented 8 months ago

thanks

I set "LOG_FILE": "" in the custom_settings. also achieved the same effect