Gc logs written to multiple locations

Just upgraded to Elasticsearch 8. and gc logs are now written to two locations. As specified in <ES_PATH_CONF>\jvm.options.d\jvm.options, but also to default location elasticsearch-8.13.4\logs\. In the location specified i jvm.options, only the configured number of gc logs are kept. In elasticsearch-8.13.4\logs\, the gc logs does not seem to be purged.

I have tested to add the file gc.options to <ES_PATH_CONF>\jvm.options.d\jvm.options. Content:

# Turn off all previous logging configuratons
-Xlog:disable

# Default settings from JEP 158, but with `utctime` instead of `uptime` to match the next line
-Xlog:all=warning:stderr:utctime,level,tags

# Enable GC logging to a custom location with a variety of options
-Xlog:gc*,gc+age=trace,safepoint:file=C:\Elasticsearch-8\logs-gc\gc9.log:utctime,pid,tags:filecount=4,filesize=64m

But then I got gc logs in three locations.

Anyone knows how to stop the gc-logs from being written to default location elasticsearch-8.13.4\logs\?

By the way, Elasticsearch 8 did not start at first when the service user (I have installed Elasticsearch as a service in Windows), did not have access to default location elasticsearch-8.13.4\logs\. I gave the service user write-permissions to elasticsearch-8.13.4\logs\, then Elasticsearch could start but wrote logs to this directory which I do not expect. Why does this happen?

Seems like gc logs are written to default log location only at startup. Could it be that Elastcsearch 8 creates gc logs before reading configuration?

Issue solved, Elasticsearch 8 obviously reads <ES_PATH_CONF>\jvm.options, creates a gc log in the directory specified in <ES_PATH_CONF>\jvm.options, then reads <ES_PATH_CONF>\jvm.options.d\jvm.options and applies the new settings for gc logging.