# Delete Old Log Files in ES 2.3.4

**URL:** <https://discuss.elastic.co/t/delete-old-log-files-in-es-2-3-4/70829>\
**Category:** Elasticsearch\
**Created:** [January 6, 2017, 11:51pm UTC](https://discuss.elastic.co/t/delete-old-log-files-in-es-2-3-4/70829 "2017-01-06T23:51:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![santsaha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/santsaha/32/6010_2.png) [@santsaha](https://discuss.elastic.co/u/santsaha)\
**Post date:** [January 6, 2017, 11:51pm UTC](https://discuss.elastic.co/t/delete-old-log-files-in-es-2-3-4/70829/1 "2017-01-06T23:51:46Z")

</div>

I want to have a logging window of 7 days in elasticsearch. I don't want to delete old indices. Found a couple of threads

> [@Deleting old ES logs /var/log/elasticsearch](https://discuss.elastic.co/t/deleting-old-es-logs-var-log-elasticsearch/21142):
>
> Hi guys, Help me configure log-retention for ES. I've struggling to delete old logfiles created by my ES clusters. I've tried several settings in logging.yml, and none of them (log4j) seems to work. The the file appenders i've tried to add MaxDateRollBackups, maxSizeRollBackups an others, no result. appender: console: type: console layout: type: consolePattern conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n" file: type: dailyRollingFile file: ${path.logs}/${cluster.name}.log …

but none provides a conclusion.

There are a few suggestions of using maxBackupIndex , but it doesn't work either.

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [January 7, 2017, 12:22am UTC](https://discuss.elastic.co/t/delete-old-log-files-in-es-2-3-4/70829/2 "2017-01-07T00:22:18Z")

</div>

I feel like at this point this is another reason to look at upgrading to 5.x. I'm fairly sure you can work out all kinds of logging stuff in 2.x but 5.x runs on log4j2 and uses log4j2's standard properties file so all the instructions on the internet about configuring log4j2 should be accurate for elasticsearch.

---

<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:** [February 4, 2017, 12:22am UTC](https://discuss.elastic.co/t/delete-old-log-files-in-es-2-3-4/70829/3 "2017-02-04T00:22:43Z")

</div>

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