Make logging configurable and/or reduce output
Is your feature request related to a problem? Please describe. When using the profiler connector to a server, the log is filled with messages along the lines of:
[2019-01-15T11:08:07.003+0000] [Payara 5.183] [SEVERE] [] [] [tid: _ThreadID=633 _ThreadName=*** Profiler Agent Special Execution Thread 8] [timeMillis: 1547550487003] [levelValue: 1000] [[
*** Profiler engine warning: CNFE in getLoadedClassInThisLoaderOnly sun.reflect.GeneratedConstructorAccessor445 for sun.reflect.GeneratedConstructorAccessor445 classloaderId 1610 classLoader: sun.reflect.DelegatingClassLoader@7dbb4a1f]]
[2019-01-15T11:08:07.003+0000] [Payara 5.183] [SEVERE] [] [] [tid: _ThreadID=633 _ThreadName=*** Profiler Agent Special Execution Thread 8] [timeMillis: 1547550487003] [levelValue: 1000] [[
*** Profiler engine warning: class sun.reflect.GeneratedConstructorAccessor445 that should be instrumented is not loaded by target VM]]
[2019-01-15T11:08:07.003+0000] [Payara 5.183] [SEVERE] [] [] [tid: _ThreadID=633 _ThreadName=*** Profiler Agent Special Execution Thread 8] [timeMillis: 1547550487003] [levelValue: 1000] [[
*** Requested classloader: sun.reflect.DelegatingClassLoader@7dbb4a1f]]
This make it hard to read the log for actual errors or information that is logged.
Describe the solution you'd like To make the log level configurable i.e. by using java.util.logging.Logger to that I can turn the visualvm logger off. Additionally the log level for these messages could be lowered.
Describe alternatives you've considered Alternatively recognise when dealing with classes generated by reflection, and not considered it an error when they then cannot be found, as all the errors come from sun.reflect.*.
Additional context Currently whenever there is an error it is sent to System.err, which is redirected in a server environment to the log, which is shared with the server logging. See https://github.com/oracle/visualvm/blob/be6f997f13db163782cd3735edf812c409fb6ca9/visualvm/libs.profiler/lib.profiler/src/org/graalvm/visualvm/lib/jfluid/server/ProfilerInterface.java#L1429 for what it currently does.