Unable to Disable G1 GC logging to stdout RHEL6

I am unable to disable the GC logging from Elasticsearch 7.x to stdout.

elasticsearch startup command:

/usr/share/elasticsearch/jdk//bin/java -Xshare:auto -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -XX:+ShowCodeDetailsInExceptionMessages -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dio.netty.allocator.numDirectArenas=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.locale.providers=SPI,COMPAT -XX:+UnlockDiagnosticVMOptions -Xms32500m -Xmx32500m -Xlog:gc=debug:file=/var/log/elasticsearch/es-data0/es_gc.log: -XX:LogFile=/var/log/elasticsearch/es-data0/es_gc.log -Djna.tmpdir=/home/elasticsearch/jnatmp -XX:+UseG1GC -XX:G1ReservePercent=30 -XX:InitiatingHeapOccupancyPercent=20 -XX:G1HeapRegionSize=16m -XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=5 -XX:ConcGCThreads=5 -server -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dio.netty.allocator.type=unpooled -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -XX:+HeapDumpOnOutOfMemoryError -verbose:gc -Djdk.tls.ephemeralDHKeySize=2048 -XX:MaxDirectMemorySize=17045651456 -Des.path.home=/usr/share/elasticsearch -Des.path.conf=/etc/elasticsearch/es-data0 -Des.distribution.flavor=default -Des.distribution.type=rpm -Des.bundled_jdk=true -cp /usr/share/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch -p /var/run/elasticsearch-es-data0/es-data0.pid -d

log4j settings:

status = error

# log action execution errors for easier debugging
logger.action.name = org.elasticsearch.action
logger.action.level = debug


appender.rolling.layout.type = ESJsonLayout
appender.rolling.layout.type_name = server

appender.rolling.type = RollingFile
appender.rolling.name = rolling
appender.rolling.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}.log
# appender.rolling.layout.type = PatternLayout
# appender.rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] [%node_name]%marker%.-10000m%n
appender.rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}-%d{yyyy-MM-dd}.log.gz
appender.rolling.policies.type = Policies
appender.rolling.policies.time.type = TimeBasedTriggeringPolicy
appender.rolling.policies.time.interval = 1
appender.rolling.policies.time.modulate = true
appender.rolling.strategy.type = DefaultRolloverStrategy
appender.rolling.strategy.action.type = Delete
appender.rolling.strategy.action.basepath = ${sys:es.logs.base_path}
appender.rolling.strategy.action.condition.type = IfFileName
appender.rolling.strategy.action.condition.glob = ${sys:es.logs.cluster_name}-*
appender.rolling.strategy.action.condition.nested_condition.type = IfLastModified
appender.rolling.strategy.action.condition.nested_condition.age = 30D

rootLogger.level = info
rootLogger.appenderRef.rolling.ref = rolling

appender.deprecation_rolling.type = RollingFile
appender.deprecation_rolling.name = deprecation_rolling
appender.deprecation_rolling.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecation.log
appender.deprecation_rolling.layout.type = ESJsonLayout
appender.deprecation_rolling.layout.type_name = server
# appender.deprecation_rolling.layout.type = PatternLayout
# appender.deprecation_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] [%node_name]%marker%.-10000m%n
appender.deprecation_rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecation-%i.log.gz
appender.deprecation_rolling.policies.type = Policies
appender.deprecation_rolling.policies.size.type = SizeBasedTriggeringPolicy
appender.deprecation_rolling.policies.size.size = 1GB
appender.deprecation_rolling.strategy.type = DefaultRolloverStrategy
appender.deprecation_rolling.strategy.max = 4

logger.deprecation.name = org.elasticsearch.deprecation
logger.deprecation.level = warn
logger.deprecation.appenderRef.deprecation_rolling.ref = deprecation_rolling
logger.deprecation.additivity = false

appender.index_search_slowlog_rolling.type = RollingFile
appender.index_search_slowlog_rolling.name = index_search_slowlog_rolling
appender.index_search_slowlog_rolling.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_index_search_slowlog.log
appender.index_search_slowlog_rolling.layout.type = ESJsonLayout
appender.index_search_slowlog_rolling.layout.type_name = server
# appender.index_search_slowlog_rolling.layout.type = PatternLayout
# appender.index_search_slowlog_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] [%node_name]%marker%.-10000m%n
appender.index_search_slowlog_rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_index_search_slowlog-%d{yyyy-MM-dd}.log.gz
appender.index_search_slowlog_rolling.policies.type = Policies
appender.index_search_slowlog_rolling.policies.time.type = TimeBasedTriggeringPolicy
appender.index_search_slowlog_rolling.policies.time.interval = 1
appender.index_search_slowlog_rolling.policies.time.modulate = true
appender.index_search_slowlog_rolling.strategy.type = DefaultRolloverStrategy
appender.index_search_slowlog_rolling.strategy.action.type = Delete
appender.index_search_slowlog_rolling.strategy.action.basepath = ${sys:es.logs.base_path}
appender.index_search_slowlog_rolling.strategy.action.condition.type = IfFileName
appender.index_search_slowlog_rolling.strategy.action.condition.glob = ${sys:es.logs.cluster_name}-*
appender.index_search_slowlog_rolling.strategy.action.condition.nested_condition.type = IfLastModified
appender.index_search_slowlog_rolling.strategy.action.condition.nested_condition.age = 7D


logger.index_search_slowlog_rolling.name = index.search.slowlog
logger.index_search_slowlog_rolling.level = trace
logger.index_search_slowlog_rolling.appenderRef.index_search_slowlog_rolling.ref = index_search_slowlog_rolling
logger.index_search_slowlog_rolling.additivity = false

appender.index_indexing_slowlog_rolling.type = RollingFile
appender.index_indexing_slowlog_rolling.name = index_indexing_slowlog_rolling
appender.index_indexing_slowlog_rolling.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_index_indexing_slowlog.log
appender.index_indexing_slowlog_rolling.layout.type = ESJsonLayout
appender.index_indexing_slowlog_rolling.layout.type_name = server
# appender.index_indexing_slowlog_rolling.layout.type = PatternLayout
# appender.index_indexing_slowlog_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] [%node_name]%marker%.-10000m%n
appender.index_indexing_slowlog_rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_index_indexing_slowlog-%d{yyyy-MM-dd}.log.gz
appender.index_indexing_slowlog_rolling.policies.type = Policies
appender.index_indexing_slowlog_rolling.policies.time.type = TimeBasedTriggeringPolicy
appender.index_indexing_slowlog_rolling.policies.time.interval = 1
appender.index_indexing_slowlog_rolling.policies.time.modulate = true
appender.index_indexing_slowlog_rolling.strategy.type = DefaultRolloverStrategy
appender.index_indexing_slowlog_rolling.strategy.action.type = Delete
appender.index_indexing_slowlog_rolling.strategy.action.basepath = ${sys:es.logs.base_path}
appender.index_indexing_slowlog_rolling.strategy.action.condition.type = IfFileName
appender.index_indexing_slowlog_rolling.strategy.action.condition.glob = ${sys:es.logs.cluster_name}-*
appender.index_indexing_slowlog_rolling.strategy.action.condition.nested_condition.type = IfLastModified
appender.index_indexing_slowlog_rolling.strategy.action.condition.nested_condition.age = 7D


logger.index_indexing_slowlog.name = index.indexing.slowlog.index
logger.index_indexing_slowlog.level = trace
logger.index_indexing_slowlog.appenderRef.index_indexing_slowlog_rolling.ref = index_indexing_slowlog_rolling
logger.index_indexing_slowlog.additivity = false

Based on everything I can find, the GC should not be logging to stdout, and should only be logging to the file specified. However, everytime I start the service I get:

[root@myhost es-data1]# service es-data1 restart
Stopping elasticsearch-es-data1:                           [  OK  ]
Checking if service already running
Checking Java
Creating PID DIR if not exists
Starting elasticsearch-es-data1:                           [  OK  ]
0
[root@myhost es-data1]# [5.488s][info][gc] Using G1
[5.505s][info][gc] Periodic GC disabled
[13.153s][info][gc] GC(0) Pause Young (Concurrent Start) (Metadata GC Threshold) 1015M->31M(32512M) 11.107ms
[13.153s][info][gc] GC(1) Concurrent Cycle
[13.164s][info][gc] GC(1) Pause Remark 47M->47M(32512M) 1.625ms
[13.166s][info][gc] GC(1) Pause Cleanup 47M->47M(32512M) 0.176ms
[13.193s][info][gc] GC(1) Concurrent Cycle 39.739ms
[14.785s][info][gc] GC(2) Pause Young (Concurrent Start) (Metadata GC Threshold) 575M->44M(32512M) 12.743ms
[14.785s][info][gc] GC(3) Concurrent Cycle
[14.796s][info][gc] GC(3) Pause Remark 59M->59M(32512M) 2.377ms
[14.797s][info][gc] GC(3) Pause Cleanup 59M->59M(32512M) 0.234ms
[14.825s][info][gc] GC(3) Concurrent Cycle 39.457ms

This should not be happening. Any help would be greatly appreciated.

bump

The jvm.options file allows you to enable/disable gc logging.

If you look at the elasticsearch startup command I posted... You will see the inclusion of the flags from the jvm.options file.. Which specifies a file to log to...
-XX:LogFile=/var/log/elasticsearch/es-data0/es_gc.log
-Xlog:gc=debug:file=/var/log/elasticsearch/es-data0/es_gc.log:
From all the docs I have seen and read through this should stop the logging to console