# Elasticsearch log duplicates into Console and RollingFile

**URL:** <https://discuss.elastic.co/t/elasticsearch-log-duplicates-into-console-and-rollingfile/232614>\
**Category:** Elasticsearch\
**Created:** [May 14, 2020, 10:23am UTC](https://discuss.elastic.co/t/elasticsearch-log-duplicates-into-console-and-rollingfile/232614 "2020-05-14T10:23:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbakti7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dbakti7/32/42250_2.png) [@dbakti7](https://discuss.elastic.co/u/dbakti7)\
**Post date:** [May 14, 2020, 10:23am UTC](https://discuss.elastic.co/t/elasticsearch-log-duplicates-into-console-and-rollingfile/232614/1 "2020-05-14T10:23:41Z")

</div>

Hi, all!  
We have some issues whereby log size grows without limit for console logs.  
From logging config, seems like ES defines 2 rootLogger (console and file) and respectively 2 settings for appenders for each of them.  
We can configure log size for "rollingFile", but it can't be done for console appender.

My questions is:  
Is it accurate to say that "console" and "file" contain the same logs, hence it's safe to remove "console" from rootLogger and appender?

In addition, is there any way to limit console appender file size? from log4j documentation seems like it's not possible. Please let me know if I missed something here.

Thank you!

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 15, 2020, 4:59am UTC](https://discuss.elastic.co/t/elasticsearch-log-duplicates-into-console-and-rollingfile/232614/2 "2020-05-15T04:59:12Z")

</div>

> [@dbakti7](#):
>
> In addition, is there any way to limit console appender file size?

The console logger doesn't write to a file, it writes to the console. If it's ending up in a file then that is being done by something outside Elasticsearch. Best to work out how it is ending up in a file and then seeing if that mechanism can be made to limit the file size.

---

<div class="post-metadata">

**Author:** ![dbakti7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dbakti7/32/42250_2.png) [@dbakti7](https://discuss.elastic.co/u/dbakti7)\
**Post date:** [May 15, 2020, 5:09am UTC](https://discuss.elastic.co/t/elasticsearch-log-duplicates-into-console-and-rollingfile/232614/3 "2020-05-15T05:09:59Z")

</div>

We start elasticsearch as a Windows service, the following are the sample log files generated from console:

 ![log_files](https://us1.discourse-cdn.com/elastic/original/3X/1/1/11bfbd89ac243a433af4b0d409b0c1873e6100ea.png)

I guess it's due to settings in service manager?

 ![service settings](https://us1.discourse-cdn.com/elastic/original/3X/c/d/cd8dbdfa43798bee31eef7fb2640617c8dd31c33.png)

If indeed it's just a logging to console, I assume it's safe for us to remove "console" from rootLogger and appender in the default logging config file?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 15, 2020, 5:35am UTC](https://discuss.elastic.co/t/elasticsearch-log-duplicates-into-console-and-rollingfile/232614/4 "2020-05-15T05:35:01Z")

</div>

Ah, sorry, I don't know what Windows does here. I'd be surprised if you couldn't rotate these logs somehow. Or indeed you can disable them and just use the file logs.

Also 2.4.0 is very old, you should upgrade.

---

<div class="post-metadata">

**Author:** ![dbakti7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dbakti7/32/42250_2.png) [@dbakti7](https://discuss.elastic.co/u/dbakti7)\
**Post date:** [May 15, 2020, 5:43am UTC](https://discuss.elastic.co/t/elasticsearch-log-duplicates-into-console-and-rollingfile/232614/5 "2020-05-15T05:43:04Z")

</div>

log4j definitely doesn't have any config for rotating console logs.  
In this case, I will explore on Windows side, else we will simply remove "console" from logging.yaml.

Yes, we are upgrading them in stages, but due to some business requirements, we still need to maintain some ES2 deployments.

Thank you for clarification @DavidTurner!

---

<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:** [June 12, 2020, 5:43am UTC](https://discuss.elastic.co/t/elasticsearch-log-duplicates-into-console-and-rollingfile/232614/6 "2020-06-12T05:43:15Z")

</div>

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