Filebeat 阻止 python 旋转日志在 windows os 中旋转文件

Filebeat prevents python rotating log from rotating files in windows os

环境: 赢 10 python 2.7 Filebeat 5.1.1

我的应用程序使用旋转日志处理程序写入日志。当我启动 Filebeat 时,我开始从日志记录库中获取以下异常。

Traceback (most recent call last):
File “C:\Anaconda2\Lib\logging\handlers.py”, line 77, in emit
   self.doRollover()
File “C:\Anaconda2\Lib\logging\handlers.py”, line 142, in 
doRollover
   os.rename(self.baseFilename, dfn)
WindowsError: [Error 183] Cannot create a file when that file already 
exists

我该如何解决?

张贴我的决议。

在 Filebeat docs 中 - 如果您在 windows 中遇到旋转日志的问题,您应该使用: close_renamed:正确 close_removed: 真

我试过了,但由于配置中的缩进错误,它没有用。 修复了它,现在我没有任何问题了。