擅长:python、mysql、java
<p>发生logrotate事件后,将发生下一件事:</p>
<ol>
<li>日志文件的索引节点没有更改,但日志被重命名为新名称(例如。注销.1条)</li>
<li>logrotate创建同名的新文件(注销)(我不确定:-)</li>
</ol>
<p>tailer模块仍将查看旧文件inode。在</p>
<p>您必须监视日志文件的inode值,以便正确跟踪日志。
这就是“尾巴-F”的意思。在</p>
<p>正如您在其源代码中看到的,tailer模块并没有设计成遵循源文件的logrotation:它基于recipe</p>
<p><a href="http://code.activestate.com/recipes/157035/" rel="nofollow">http://code.activestate.com/recipes/157035/</a></p>
<p>对你的任务来说是无用的。在</p>
<p>请查看源配方的注释。在</p>
<p>在</p>
<p>请注意,或者用我的一个,它是“tail-f”的包装器:)</p>
<p><a href="http://code.activestate.com/recipes/577398-tail-f-with-inode-monitor/" rel="nofollow">http://code.activestate.com/recipes/577398-tail-f-with-inode-monitor/</a></p>