RFR: 8257872: UL: -Xlog does not check number of options
Koichi Sakata
ksakata at openjdk.java.net
Wed Dec 9 03:07:34 UTC 2020
On Wed, 9 Dec 2020 00:59:56 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> In Unified Logging options can be specified up to four (`-Xlog[:[selections][:[output][:[decorators][:output-options]]]]`).
>> But it’s possible to specify options with more colons like `java -Xlog:::::`.
>> It’s better to show a message when more options are specified than maximum number.
>>
>> By this PR a warning message is outputted when options are specified more than the max number.
>
> Should this be a warning or an error? The behavior seems inconsistent:
>
> $ java -Xlog:gc=error:::foo -version
> [0.000s][warning][logging] Output options for existing outputs are ignored.
> java version "16-internal" 2021-03-16
> Java(TM) SE Runtime Environment (build 16-internal+0-adhoc.iklam.open)
> Java HotSpot(TM) 64-Bit Server VM (build 16-internal+0-adhoc.iklam.open, mixed mode, sharing)
>
> $ java -Xlog:gc=error::foo -version
> [0.000s][error][logging] Invalid decorator 'foo'.
> Invalid -Xlog option '-Xlog:gc=error::foo', see error log for details.
> Error: Could not create the Java Virtual Machine.
> Error: A fatal exception has occurred. Program will exit.
In this PR I chose a warning level to ignore the invalid option and run a application. It isn't serious thing and some people might run with invalid option already.
The fourth option is for output-option and can be described relatively free. So I suspect that it is ignored even when it is invalid.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1685
More information about the hotspot-runtime-dev
mailing list