# Disable Log4j rotation

**URL:** <https://discuss.elastic.co/t/disable-log4j-rotation/68881>\
**Category:** Elasticsearch\
**Created:** [December 13, 2016, 2:28pm UTC](https://discuss.elastic.co/t/disable-log4j-rotation/68881 "2016-12-13T14:28:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Clement\_Ros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clement_ros/32/6198_2.png) [@Clement\_Ros](https://discuss.elastic.co/u/Clement_Ros)\
**Post date:** [December 13, 2016, 2:28pm UTC](https://discuss.elastic.co/t/disable-log4j-rotation/68881/1 "2016-12-13T14:28:37Z")

</div>

Hi,

I use Elasticsearch 5.1.

I want to disable the rotation of Elasticsearch log file made by Log4j but i don't know how log4j work so i ask here.

How can i do that ?

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [December 13, 2016, 2:38pm UTC](https://discuss.elastic.co/t/disable-log4j-rotation/68881/2 "2016-12-13T14:38:28Z")

</div>

How would you like to log instead?

---

<div class="post-metadata">

**Author:** ![Clement\_Ros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clement_ros/32/6198_2.png) [@Clement\_Ros](https://discuss.elastic.co/u/Clement_Ros)\
**Post date:** [December 13, 2016, 2:39pm UTC](https://discuss.elastic.co/t/disable-log4j-rotation/68881/3 "2016-12-13T14:39:20Z")

</div>

I don't want to stop the log, i want to stop the rotation of the log file.

---

<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:** [December 13, 2016, 3:00pm UTC](https://discuss.elastic.co/t/disable-log4j-rotation/68881/4 "2016-12-13T15:00:51Z")

</div>

There should be a `log4j2.properties` file in the `config` directory or `/etc/elasticsearch` if you installed via RPM or DEB. [Here](https://logging.apache.org/log4j/2.x/manual/configuration.html#Properties) are the docs for that.

---

<div class="post-metadata">

**Author:** ![Clement\_Ros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clement_ros/32/6198_2.png) [@Clement\_Ros](https://discuss.elastic.co/u/Clement_Ros)\
**Post date:** [December 13, 2016, 3:34pm UTC](https://discuss.elastic.co/t/disable-log4j-rotation/68881/5 "2016-12-13T15:34:16Z")

</div>

Yes, i saw that file, but I do not know what parameter I have to comment to disable the rotation of the log file.

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [December 13, 2016, 4:16pm UTC](https://discuss.elastic.co/t/disable-log4j-rotation/68881/6 "2016-12-13T16:16:49Z")

</div>

Hi,

What I meant was: if you want to stop rotation of the log file, what behaviour do you want instead? One large file that always grows bigger? Create log files and roll over but never delete the old ones?  
There are various options and to decide which ones to choose it's necessary to describe the behaviour you want.

---

<div class="post-metadata">

**Author:** ![Clement\_Ros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clement_ros/32/6198_2.png) [@Clement\_Ros](https://discuss.elastic.co/u/Clement_Ros)\
**Post date:** [December 14, 2016, 7:45am UTC](https://discuss.elastic.co/t/disable-log4j-rotation/68881/7 "2016-12-14T07:45:06Z")

</div>

I want to use Logrotate to do the rotation of the file.  
I want 1 file per day.  
The file of two days ago must be compressed and sent via rsync on a remote server.  
I know how to do that with logrotate, i just want to disable the log4j rotation, to not have 2 services who make the rotation.

---

<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:** [January 11, 2017, 7:45am UTC](https://discuss.elastic.co/t/disable-log4j-rotation/68881/8 "2017-01-11T07:45:35Z")

</div>

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