JDK-8154791 : Xlog classload too redundant msgs info/debug
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-04-20
  • Updated: 2017-08-25
  • Resolved: 2017-05-08
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 10
10 b21Fixed
Related Reports
Relates :  
Description
With -Xlog:classload=debug the info and debug level messages are too similar where the debug line is a superset of the info line and it looks funny to have 2 very similar log lines.

How about  move the "[class loader 0x00007fbb7801bf40a 'chickentest/MyNonDefiningURLLoader']" info into the info level because IMO app developers are interested in the name and uniqueness of the class loader, not the "klass: 0x00000008012a1220 super: 0x0000000801001788" info which is more for JVM supportability.
This is b113-ish.

Here is an example:

[0.389s][info ][classload] sun.security.util.ManifestEntryVerifier source: shared objects file
[0.389s][debug][classload] sun.security.util.ManifestEntryVerifier source: shared objects file klass: 0x0000000801267770 super: 0x0000000801001788 loader: [NULL class_loader]
[0.389s][info ][classload] sun.nio.ByteBuffered source: shared objects file
[0.389s][debug][classload] sun.nio.ByteBuffered source: shared objects file klass: 0x0000000801268178 super: 0x0000000801001788 loader: [NULL class_loader]
[0.390s][info ][classload] hidden.HiddenMsgThread source: file:/tmp/ChickenLib.jar
[0.390s][debug][classload] hidden.HiddenMsgThread source: file:/tmp/ChickenLib.jar klass: 0x000000080247e828 super: 0x0000000801024e80 loader: [class loader 0x00007fbb78002290a 'chickentest/MyNonDefiningURLLoader'] bytes: 2682 checksum: a9f5af54

Comments
The output should be changed to two lines like this (i.e., remove the duplicated part from the [debug] output): [0.389s][info ][classload] sun.security.util.ManifestEntryVerifier source: shared objects file [0.389s][debug][classload] klass: 0x0000000801267770 super: 0x0000000801001788 loader: [NULL class_loader] In order for the output to be parseable, the two lines should be grouped together using LogMessageBuffer (see JDK-8145934) to prevent the interleaving of other log messages between the two lines.
03-05-2017

[~mockner] Please reassess logging messages
22-04-2016

I'm inclined to agree - the classloader seems important/useful information to have as part of the classload "info" logging. That said we can't assume info level logging is always enabled when debug logging is enabled (it is by default), so the debug lines still have to be standalone. Duplication seems somewhat inevitable without some convoluted guards on the logging statements.
21-04-2016