RFR: 8257872: UL: -Xlog does not check number of options
Ioi Lam
iklam at openjdk.java.net
Wed Dec 9 01:02:38 UTC 2020
On Tue, 8 Dec 2020 03:02:03 GMT, Koichi Sakata <ksakata 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.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1685
More information about the hotspot-runtime-dev
mailing list