# Rolling Elasticsearch Logs by Size

**URL:** https://discuss.elastic.co/t/rolling-elasticsearch-logs-by-size/40750
**Category:** Elasticsearch
**Created:** [February 2, 2016, 3:37pm UTC](https://discuss.elastic.co/t/rolling-elasticsearch-logs-by-size/40750 "2016-02-02T15:37:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)
#### Post date: [February 2, 2016, 3:37pm UTC](https://discuss.elastic.co/t/rolling-elasticsearch-logs-by-size/40750/1 "2016-02-02T15:37:07Z")

</div>

Hi,  
I am trying to improve management of our elasticsearch logs. To that end I'm trying to implement a policy of rolling the log when it exceeds a certain size and to retain a fixed number of compressed logs. Here is my config:

file:  
type: extrasRollingFile  
file: ${path.logs}/${[cluster.name](http://cluster.name)}.log  
rollingPolicy: fixedWindowRollingPolicy  
rollingPolicy.FileNamePattern: ${path.logs}/${[cluster.name](http://cluster.name)}.log.%d{yyyy-MM-dd}.gz  
rollingPolicy.MinIndex: 1  
rollingPolicy.MaxIndex: 10  
triggeringPolicy: sizeBasedTriggeringPolicy  
triggeringPolicy.MaxFileSize: 1000MB  
layout:  
type: pattern  
conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"

Of course, this isn't working as nothing is being written to the log. Can someone point me in the right direction to getting this config working please?

Regards,  
David

---

<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: [July 5, 2017, 11:19pm UTC](https://discuss.elastic.co/t/rolling-elasticsearch-logs-by-size/40750/2 "2017-07-05T23:19:35Z")

</div>


