Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8190346

improve unified JVM logging help message and warnings


    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 10
    • Fix Version/s: 11
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:


      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`.


          Issue Links



              • Assignee:
                mlarsson Marcus Larsson (Inactive)
                dnsimon Douglas Simon
              • Votes:
                0 Vote for this issue
                1 Start watching this issue


                • Created: