Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
编辑:我想在 python 中有一个每天旋转的记录器。例如将创建以下日志文件..
例如
log_20130701 log_20130702 log_20130703 log_20130704
您可以使用日期设置文件名。
import datetime ... logConfig['filename'] = 'error.log_%s' % datetime.datetime.now().strftime('%d.%m.%Y') ... log.dictConfig(logConfig)