My application writes logs with Rotating log handler. When I start Filebeat I start getting the following exceptions from logging lib.
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)
the problem is when Python logger tries to rotate the file, he removes the old one and on that command I get exception, because Flebeat still holds the file open.
Oh, so the time between removing the old file and renaming is very short? So I guess it's not enough time for Filebeat to close the file. Maybe if you try using close_inactive the old file will closed by Filebeat before it's time for rotation.
The indentation is wrong. None of the close_x settings will be applied as written. These options are members of the prospector config and need to be indented at the same level as paths and input_type. Each prospector can use different settings therefore these are not global settings.
filebeat.prospectors:
- input_type: log
paths:
- my path
close_inactive: 30s
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.