thanks for the links Uwe, JEP 158 is interesting.
Between the GC logging options that have been removed, and how the unified logging now deals with multiple tags (gc, all, etc..) & output specifiers (stdout, stderr, for file) in a single '-Xlog' param; it doesn't look viable to have an exact java9 equivilent for what the bin/solr script currently does with SOLR_LOGS_DIR & GC_LOG_OPTS
The attached patch attempts to support the same ideas as best as (i can see) possible under java9...
- if the user doesn't configure a GC_LOG_OPTS, then we (still) use a (verbose) default value for this param via '-Xlog:gc*'
- if the user configures a blank value for GC_LOG_OPTS, we (still) leave the param blank
- if the effective value of GC_LOG_OPTS is non blank, then foreach param option specified in GC_LOG_OPTS:
- if it starts with '-Xlog:gc', and does not include an output specifier, then:
- add a 'file' output specifier based on SOLR_LOGS_DIR (to mimic the '-Xloggc' param we use w/ java8)
- add time,uptime decorators (to mimic the -XX params we use w/ java8)
- add filecount=9,filesize=20000 output-options (to mimic the -XX params we use w/ java8)
(for simplicity, if the user wants to specify multiple JEP158 tags in the '-Xlog' param , then the tag list has to start with "gc" in order for us to add a file option – otherwise we ignore it. likewise if the user wants to specify their own decorators or output-options, then they must also specify their own output (file, or stdout, or stderr) specifier as well, since it must come first in the '-Xlog' format string)
While fixing this, I also did some small cleanup in how the java -version output is parsed.
Would appreciate detailed review & manual testing from folks since this type of script work is hard to write automated tests for.