使用: concurrent-log-handler
GITHUB: https://github.com/Preston-Landers/concurrent-log-handler
安装: pip install concurrent-log-handler
import logging from concurrent_log_handler import ConcurrentRotatingFileHandler logger = logging.getLogger(__name__) handler = ConcurrentRotatingFileHandler(filename=log_file, mode="a", maxBytes=10 * 1024,
backupCount=5,encoding='utf-8') logger.addHandler(handler)
参考文章:python logging模块“另一个程序正在使用此文件,进程无法访问。”问题解决办法-百度网盘下载-Java自学者论坛 - Powered by Discuz! (javazxz.com)
标签:logging,log,无法访问,concurrent,handler,模块,日志 From: https://www.cnblogs.com/lidabo/p/18302837