# How to configure log in elasticsearch 5.4?

**URL:** https://discuss.elastic.co/t/how-to-configure-log-in-elasticsearch-5-4/95012
**Category:** Elasticsearch
**Created:** [July 28, 2017, 8:51pm UTC](https://discuss.elastic.co/t/how-to-configure-log-in-elasticsearch-5-4/95012 "2017-07-28T20:51:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![MountainMoon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mountainmoon/32/125700_2.png) [@MountainMoon](https://discuss.elastic.co/u/MountainMoon)
#### Post date: [July 28, 2017, 8:51pm UTC](https://discuss.elastic.co/t/how-to-configure-log-in-elasticsearch-5-4/95012/1 "2017-07-28T20:51:34Z")

</div>

Hi All:  
After installing the elasticsearch 5.4 I got an issue with logs, logs are too large (over 30 GB a day). I looked into the log4j2.properties configuration file and found some of the log level are set to "info", so I changed it to "error" as the following:

> status = error  
> logger.action.name = org.elasticsearch.action  
> logger.action.level = error
> 
> appender.console.type = Console  
> appender.console.name = console  
> appender.console.layout.type = PatternLayout  
> appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n
> 
> appender.rolling.type = RollingFile  
> appender.rolling.name = rolling  
> appender.rolling.fileName = ${sys:es.logs.base\_path}${sys:file.separator}${sys:es.logs.cluster\_name}.log  
> appender.rolling.layout.type = PatternLayout  
> appender.rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%.-10000m%n  
> appender.rolling.filePattern = ${sys:es.logs.base\_path}${sys:file.separator}${sys:es.logs.cluster\_name}-%d{yyyy-MM-dd}.log  
> appender.rolling.policies.type = Policies  
> appender.rolling.policies.time.type = TimeBasedTriggeringPolicy  
> appender.rolling.policies.time.interval = 1  
> appender.rolling.policies.time.modulate = true
> 
> rootLogger.level = error  
> rootLogger.appenderRef.console.ref = console  
> rootLogger.appenderRef.rolling.ref = rolling
> 
> appender.deprecation\_rolling.type = RollingFile  
> appender.deprecation\_rolling.name = deprecation\_rolling  
> appender.deprecation\_rolling.fileName = ${sys:es.logs.base\_path}${sys:file.separator}${sys:es.logs.cluster\_name}\_deprecation.log  
> appender.deprecation\_rolling.layout.type = PatternLayout  
> appender.deprecation\_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%.-10000m%n  
> appender.deprecation\_rolling.filePattern = ${sys:es.logs.base\_path}${sys:file.separator}${sys:es.logs.cluster\_name}\_deprecation-%i.log.gz  
> appender.deprecation\_rolling.policies.type = Policies  
> appender.deprecation\_rolling.policies.size.type = SizeBasedTriggeringPolicy  
> appender.deprecation\_rolling.policies.size.size = 1GB  
> appender.deprecation\_rolling.strategy.type = DefaultRolloverStrategy  
> appender.deprecation\_rolling.strategy.max = 4
> 
> logger.deprecation.name = org.elasticsearch.deprecation  
> logger.deprecation.level = error  
> logger.deprecation.appenderRef.deprecation\_rolling.ref = deprecation\_rolling  
> logger.deprecation.additivity = false
> 
> appender.index\_search\_slowlog\_rolling.type = RollingFile  
> appender.index\_search\_slowlog\_rolling.name = index\_search\_slowlog\_rolling  
> appender.index\_search\_slowlog\_rolling.fileName = ${sys:es.logs.base\_path}${sys:file.separator}${sys:es.logs.cluster\_name}\_index\_search\_slowlog.log  
> appender.index\_search\_slowlog\_rolling.layout.type = PatternLayout  
> appender.index\_search\_slowlog\_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%.-10000m%n  
> appender.index\_search\_slowlog\_rolling.filePattern = ${sys:es.logs.base\_path}${sys:file.separator}${sys:es.logs.cluster\_name}\_index\_search\_slowlog-%d{yyyy-MM-dd}.log  
> appender.index\_search\_slowlog\_rolling.policies.type = Policies  
> appender.index\_search\_slowlog\_rolling.policies.time.type = TimeBasedTriggeringPolicy  
> appender.index\_search\_slowlog\_rolling.policies.time.interval = 1  
> appender.index\_search\_slowlog\_rolling.policies.time.modulate = true
> 
> logger.index\_search\_slowlog\_rolling.name = index.search.slowlog  
> logger.index\_search\_slowlog\_rolling.level = trace  
> logger.index\_search\_slowlog\_rolling.appenderRef.index\_search\_slowlog\_rolling.ref = index\_search\_slowlog\_rolling  
> logger.index\_search\_slowlog\_rolling.additivity = false
> 
> appender.index\_indexing\_slowlog\_rolling.type = RollingFile  
> appender.index\_indexing\_slowlog\_rolling.name = index\_indexing\_slowlog\_rolling  
> appender.index\_indexing\_slowlog\_rolling.fileName = ${sys:es.logs.base\_path}${sys:file.separator}${sys:es.logs.cluster\_name}\_index\_indexing\_slowlog.log

But it doesn't help. Do I need to change some values in the log configuration? Or I need to start this node to get the configuration work? Thanks a lot!

---

<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: [August 25, 2017, 8:51pm UTC](https://discuss.elastic.co/t/how-to-configure-log-in-elasticsearch-5-4/95012/2 "2017-08-25T20:51:36Z")

</div>

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