# Application logs rotation issue

**URL:** <https://discuss.elastic.co/t/application-logs-rotation-issue/158751>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [November 29, 2018, 12:13pm UTC](https://discuss.elastic.co/t/application-logs-rotation-issue/158751 "2018-11-29T12:13:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![W.anjum](https://avatars.discourse-cdn.com/v4/letter/w/a9a28c/32.png) [@W.anjum](https://discuss.elastic.co/u/W.anjum)\
**Post date:** [November 29, 2018, 12:13pm UTC](https://discuss.elastic.co/t/application-logs-rotation-issue/158751/1 "2018-11-29T12:13:35Z")

</div>

I have application that rotates its log files using python file rotation module every hour. Whenever I run **filebeat** my application crashes with the error **'Cannot Rename: Text File Busy'**. I have tried close\_\* option and different cofigs but nothing is working. Filebeat still has lock on files.

There are lot of thread related to this but I haven't found solution in any of it.

---

<div class="post-metadata">

**Author:** ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)\
**Post date:** [November 30, 2018, 11:26am UTC](https://discuss.elastic.co/t/application-logs-rotation-issue/158751/2 "2018-11-30T11:26:12Z")

</div>

Could you please share your Filebeat configuration formatted using `</>`?

---

<div class="post-metadata">

**Author:** ![W.anjum](https://avatars.discourse-cdn.com/v4/letter/w/a9a28c/32.png) [@W.anjum](https://discuss.elastic.co/u/W.anjum)\
**Post date:** [December 4, 2018, 1:43pm UTC](https://discuss.elastic.co/t/application-logs-rotation-issue/158751/3 "2018-12-04T13:43:23Z")

</div>

Thanks for reply. I have solved this issue by specifying the option **close\_eof: true** and setting **scan\_frequency to 10s**. Now whenever my application tries to rotate logs there is no read lock on file and it is rotated successfully. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 1, 2019, 1:43pm UTC](https://discuss.elastic.co/t/application-logs-rotation-issue/158751/4 "2019-01-01T13:43:41Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
