How to set the JVM Garbage Collector logs to the stdout and not in /var/log/elasticsearch/gc.log

Hello,

I would like to put an option in my docker-compose.yml (ES_JAVA_OPTS) to say at the JVM to write logs on the stdout but if I give the stdout path, it says that I don't have the rights ("permission denied") and I can't find any option to do that.. Is there a solution ?

I have seen that in /etc/elasticsearch/ there is a file jvm.options where the logs file path is specified :

-Xloggc:/var/log/elasticsearch/gc.log

Maybe is it possible to specify on the docker-compose to change this path to stdout or comment this line for let the default jvm parameter which is to write logs on the stdout ?

Please give me some ideas, I really don't know how to do :sweat_smile:

PS : when I change for example the name of the log file ("ES_JAVA_OPTS: -Xms1G -Xmx1G -Xloggc:/var/log/elasticsearch/gc_test.log" in docker-compose.yml), it works. It's just the stdout that doesn't work..

IIRC the default output is stdout, as long as the jvm options to print gc times are set, you can omit -Xloggc and then everything should be written to stdout.

Thanks for your answer,
Yes normally it's like that but ES change JVM default options so even if I don't specify -Xloggc in my docker-compose, it follows the ES jvm.options file which is in the docker container.. I would like to say in the docker-compose file to write JVM logs in the stdout and not to listen the jvm.options file

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