# Filebeat locks file when logstash is not runnig

**URL:** <https://discuss.elastic.co/t/filebeat-locks-file-when-logstash-is-not-runnig/66719>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [November 21, 2016, 1:22pm UTC](https://discuss.elastic.co/t/filebeat-locks-file-when-logstash-is-not-runnig/66719 "2016-11-21T13:22:37Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![eluppol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eluppol/32/13321_2.png) [@eluppol](https://discuss.elastic.co/u/eluppol)\
**Post date:** [November 22, 2016, 1:53pm UTC](https://discuss.elastic.co/t/filebeat-locks-file-when-logstash-is-not-runnig/66719/7 "2016-11-22T13:53:28Z")

</div>

I'm using log4cxx RollingFileAppender configured to rotate files every 1MB.  
The problem is only with the last file, which cannot be deleted and as I understand it leads to situation when logs are accumulated in the original log file (log4cxx.log), so it becomes very large. When I stop filebeat, rotation process is resumed immediately, so log4cxx.log becomes log4cxx.log.1, log4cxx.log.1 becomes log4cxx.log.2 and so on... and log4cxx.log.10 is removed.

---

_[View the full topic](https://discuss.elastic.co/t/filebeat-locks-file-when-logstash-is-not-runnig/66719)._
