JDK-8172384 : JMX Connector ready address logging should be INFO level
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Won't Fix
  • CPU: x86
  • Submitted: 2017-01-06
  • Updated: 2019-08-02
  • Resolved: 2017-07-11
Description
A DESCRIPTION OF THE REQUEST :
The JMX connector server can be configured with port=0 like so to allow automatic selection of an open port:

com.sun.management.jmxremote.port=0

However, the usefulness of this approach is limited by the fact that logging of the address on which the server is listening is done at the CONFIG level like so (note: logging captured from OSX, but this behavior seems to be the same on all platforms):

Jan 06, 2017 12:58:44 PM ConnectorBootstrap startRemoteConnectorServer
CONFIG: JMX Connector ready at: service:jmx:rmi:///jndi/rmi://MAC-BR8984:49567/jmxrmi

The problem is that default logging level is INFO and as such it requires adjusting logging configuration to be able to see this.

I have found using port=0 to be very valuable in situations such as with configuration of MapReduce task JVMs in the Hadoop platform.  Many task JVMs are launched per node and it is not feasible to predefine ports for all of them.  Predefined ports are destined to collide as two tasks would attempt to use the same port at the same time.

The problem is when I do this I have to much with the logging configuration to be able to figure out which port is being used.  The port can also be figured out by listing processes and open ports and using process of elimination but that is a real pain.

It seems like it would be very reasonable and simple to change this line of logging to INFO level.

JUSTIFICATION :
Justification included in description.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
"JMX Connector ready at:" logged at INFO level, which shows up with in the console log with default logging configuration.
ACTUAL -
"JMX Connector ready at:" logged at CONFIG level, which by default is invisible from the console log.

---------- BEGIN SOURCE ----------
Any Java application can be used to demonstrate this.  Just launch with the following JVM args:

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=0
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false

Observe that nothing shows up in the console log to indicate that the JMX connector server is running or on what port.
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Updating logging.properties to set log level to CONFIG.


Comments
This can be treated as bug instead of enhancement. JMX URL (which has the port number) will be available via JDP as well. JDP can be enabled by specifying flag '-Dcom.sun.management.jmxremote.autodiscovery=true'. Some of other JDP parameters are -Dcom.sun.management.jdp.pause, -Dcom.sun.management.jdp.name, -Dcom.sun.management.jdp.address,-Dcom.sun.management.jdp.port,
12-02-2017

This is an enhancement request to change the logging mechanism for "JMX Connector ready at:" to INFO instead of CONFIG
09-01-2017