# Tried to override GC log settings, doubled the logging instead

**URL:** <https://discuss.elastic.co/t/tried-to-override-gc-log-settings-doubled-the-logging-instead/294277>\
**Category:** Elasticsearch\
**Created:** [January 13, 2022, 1:20pm UTC](https://discuss.elastic.co/t/tried-to-override-gc-log-settings-doubled-the-logging-instead/294277 "2022-01-13T13:20:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![OrangeDog](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/orangedog/32/4630_2.png) [@OrangeDog](https://discuss.elastic.co/u/OrangeDog)\
**Post date:** [January 13, 2022, 1:20pm UTC](https://discuss.elastic.co/t/tried-to-override-gc-log-settings-doubled-the-logging-instead/294277/1 "2022-01-13T13:20:17Z")

</div>

I used to edit `/etc/elasticsearch/jvm.options` in order to reduce the amount of GC logging.

As directed in a recent update, I've now moved my changes to `/etc/elasticsearch/jvm.options.d/gc.options`.

However, instead of overriding the default option, this now causes it to log twice, one with each setting. I've confirmed this by changing the file name.

How are you supposed to change that setting without editing `/etc/elasticsearch/jvm.options`?

```nohighlight
# cat /etc/elasticsearch/jvm.options.d/gc.options
9-:-Xlog:gc*,gc+age=trace,safepoint:file=/var/log/elasticsearch/gc-2.log:utctime,pid,tags:filecount=8,filesize=64m
# ls -lh /var/log/elasticsearch/gc*
-rw-r--r-- 1 elasticsearch elasticsearch 338K Jan 13 13:14 gc-2.log
-rw-r--r-- 1 elasticsearch elasticsearch 2.1K Jan 13 13:07 gc-2.log.0
-rw-r--r-- 1 elasticsearch elasticsearch 338K Jan 13 13:14 gc.log
-rw-r--r-- 1 elasticsearch elasticsearch 2.1K Jan 13 13:03 gc.log.00
-rw-r--r-- 1 elasticsearch elasticsearch 206K Jan 13 13:07 gc.log.01
-rw-r--r-- 1 elasticsearch elasticsearch 2.1K Jan 13 13:07 gc.log.02

```

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [January 25, 2022, 3:45pm UTC](https://discuss.elastic.co/t/tried-to-override-gc-log-settings-doubled-the-logging-instead/294277/2 "2022-01-25T15:45:44Z")

</div>

You probably need to comment out the `gc.log` line in the `jvm.options` file as those options are simply appended together.

---

<div class="post-metadata">

**Author:** ![OrangeDog](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/orangedog/32/4630_2.png) [@OrangeDog](https://discuss.elastic.co/u/OrangeDog)\
**Post date:** [January 25, 2022, 4:14pm UTC](https://discuss.elastic.co/t/tried-to-override-gc-log-settings-doubled-the-logging-instead/294277/3 "2022-01-25T16:14:36Z")

</div>

Then it shouldn't be telling you never to edit the file, and/or it shouldn't have GC logging enabled by default.

---

<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 22, 2022, 4:14pm UTC](https://discuss.elastic.co/t/tried-to-override-gc-log-settings-doubled-the-logging-instead/294277/4 "2022-02-22T16:14:40Z")

</div>

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