标签:.com 文章 evel scrapy 级别 class rap warning work
执行自动化操作时,如果出错,需要通过日志功能保存错误信息,这里写下从网上找到的相关配置资料
# 日志 to_day = datetime.datetime.now() # 每日日志分类 LOG_ENABLED = True # 启用日志,默认不启用 LOG_ENCODING = ‘utf-8‘ LOG_FILE = "E:\SpiderFramework\log\scrapy_{}_{}_{}.log".format(to_day.year,to_day.month,to_day.day) LOG_LEVEL = ‘WARNING‘ # 级别 LOG_STDOUT = True # 输出重定向至log日志,比如print ‘‘‘ 严重程度由低到高排序:DEBUG < INFO < WARNING < ERROR < CRITICAL 相关参考文章: https://blog.csdn.net/weixin_41666747/article/details/82716688 https://www.cnblogs.com/shouzhong/p/7685822.html https://www.jianshu.com/p/99d4426c4366 https://docs.python.org/3/howto/logging.html https://docs.scrapy.org/en/latest/topics/logging.html ‘‘‘
标签:.com 文章 evel scrapy 级别 class rap warning work
原文地址:https://www.cnblogs.com/hejianlong/p/10019383.html