python基于scrapy配置日志
.setting文件配置log日志
'''''' # start logger configure setting current_day = datetime.datetime.now() LOG_ENABLED = True # 启用日志,默认不启用 LOG_ENCODING = 'utf-8' # 默认: 'utf-8',logging使用的编码 LOG_FILE = "../log/{}-{}-{}.log".format(current_day.year, current_day.month, current_day.day) # Scrapy提供5层logging级别: # CRITICAL - 严重错误(critical) # ERROR - 一般错误(regular errors) # WARNING - 警告信息(warning messages) # INFO - 一般信息(informational messages) # DEBUG - 调试信息(debugging messages) LOG_LEVEL = "INFO" LOG_STDOUT = False # 输出重定向至log日志,比如print # end logger configure setting