JDK-8190346 : improve unified JVM logging help message and warnings
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 10
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-10-30
  • Updated: 2019-06-20
  • Resolved: 2018-02-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11 b04Fixed
Related Reports
Relates :  
Description
It's currently quite easy to misinterpret the help message produced by -Xlog:help. For example, I wanted to enable this logging code in nmethod.cpp:

  LogTarget(Trace, class, unload) lt;

and tried `-Xlog:unload=trace`. I overlooked the part of the help message that says "Unless wildcard (*) is specified, only log messages tagged with exactly the tags specified will be matched" otherwise I would have known that `-Xlog:class+unload=trace` or `-Xlog:unload*=trace` is what I needed. With my incorrectly specified option, I only get this warning:

[0.002s][warning][logging] No tag set matches selection(s): class

To produce such a warning message, the set of allowed tag combinations must be available. As such, the warning could be improved to suggest combinations close to what the user trued based on some fuzzy match (c.f., mistyped VM options):

[0.002s][warning][logging] No tag set matches selection(s): unload. Did you mean one of the following supported tag sets: class+load, class+unload, class*

In addition, the actual set of supported tag sets could be shown in the help message instead of just the individual tags, some of which (like `class`) cannot be used on their own. Or maybe the help message should just state that these tag sets can be seen with `-Xlog:logging=trace`.