# Log file rolling by size

**URL:** <https://discuss.elastic.co/t/log-file-rolling-by-size/9647>\
**Category:** Elasticsearch\
**Created:** [November 9, 2012, 10:44am UTC](https://discuss.elastic.co/t/log-file-rolling-by-size/9647 "2012-11-09T10:44:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ulli](https://avatars.discourse-cdn.com/v4/letter/u/f04885/32.png) [@Ulli](https://discuss.elastic.co/u/Ulli)\
**Post date:** [November 9, 2012, 10:44am UTC](https://discuss.elastic.co/t/log-file-rolling-by-size/9647/1 "2012-11-09T10:44:49Z")

</div>

Hi,

Is there a possibility to configure the logging.yml that log file a rolled  
by size (instead of dailyRollingFile)?  
Is there a documentation of all logging options anywhere?

Thanks in advance, Ulli

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [November 9, 2012, 10:55pm UTC](https://discuss.elastic.co/t/log-file-rolling-by-size/9647/2 "2012-11-09T22:55:55Z")

</div>

By default elasticsearch is using log4j. So, the logging.yml file is  
basically standard log4j.properties file only translated from .properties  
format into YAML format and with all log4j. prefixes omitted. Basically  
something like

rootLogger: INFO, console, file  
logger:

# log action execution errors for easier debugging

action: DEBUG  
.....

in standard log4j.properties file would look like

log4j.rootLogger=INFO, console, file  
log4j.logger.action=DEBUG  
.....

The log4j configuration is explained  
here: [Apache log4j 1.2 - Short introduction to log4j](http://logging.apache.org/log4j/1.2/manual.html)

To setup log file rolled by size, you need to replace dailyRollingFile  
appender with rollingFile[http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/RollingFileAppender.html](http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/RollingFileAppender.html)appender and remove datePattern. For example:

appender:  
.....  
file:  
type: rollingFile  
file: ${path.logs}/${cluster.name}.log  
maxFileSize: 10000000  
maxBackupIndex: 10  
layout:  
type: pattern  
conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"

On Friday, November 9, 2012 5:44:49 AM UTC-5, Ulli wrote:

> Hi,
> 
> Is there a possibility to configure the logging.yml that log file a rolled  
> by size (instead of dailyRollingFile)?  
> Is there a documentation of all logging options anywhere?
> 
> Thanks in advance, Ulli

--

---

<div class="post-metadata">

**Author:** ![Ulli](https://avatars.discourse-cdn.com/v4/letter/u/f04885/32.png) [@Ulli](https://discuss.elastic.co/u/Ulli)\
**Post date:** [November 12, 2012, 9:01am UTC](https://discuss.elastic.co/t/log-file-rolling-by-size/9647/3 "2012-11-12T09:01:34Z")

</div>

Thank you.

--

---

<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 6, 2017, 3:04am UTC](https://discuss.elastic.co/t/log-file-rolling-by-size/9647/4 "2017-07-06T03:04:51Z")

</div>


