Elasticsearch log duplicates into Console and RollingFile

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!

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.

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

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

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?

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.

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!

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