# Log entries gets truncated on file rotation

**URL:** <https://discuss.elastic.co/t/log-entries-gets-truncated-on-file-rotation/66725>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [November 21, 2016, 1:42pm UTC](https://discuss.elastic.co/t/log-entries-gets-truncated-on-file-rotation/66725 "2016-11-21T13:42:35Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [November 22, 2016, 1:51pm UTC](https://discuss.elastic.co/t/log-entries-gets-truncated-on-file-rotation/66725/6 "2016-11-22T13:51:12Z")

</div>

I'm currently trying to understand what DailyRollingFileAppender exactly does: [https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html](https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html) Based on this page: `DailyRollingFileAppender has been observed to exhibit synchronization issues and data loss. The log4j extras companion includes alternatives which should be considered for new deployments and which are discussed in the documentation for org.apache.log4j.rolling.RollingFileAppender.` Based on this note I have the suspicion the problem could also be related to what DailyRollingFileAppender does. Any reason you use this one?

Back to the problem: As far as I understand the appender logs everything to the same file but copies over the last day to a separate file. The part I didn't find is when the same file is actually truncated or is it removed and a new one is created?

---

_[View the full topic](https://discuss.elastic.co/t/log-entries-gets-truncated-on-file-rotation/66725)._
